BxDolEvents

Hi All

Just a quick question. Let say I was to copy the events.php and BxDolEvents.php file and rename them to events2.php and BxDolEvents2.php then edit the code in the events.php file on line 30 from

require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolEvents.php' );
to

require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolEvents2.php' );

then go to my url http://www.mysite.com/events2.php

why is the page showing blank.

There is a long long long reason why i need this but I dont want to boar you with the details.

Thank

Quote · 18 Jul 2009

We would need to see the page code to answer that question. 

Quote · 18 Jul 2009

from which file would you need to see the code.

Here is the code from the events2.php file

<?php

/***************************************************************************
*                            Dolphin Smart Community Builder
*                              -----------------
*     begin                : Mon Mar 23 2006
*     copyright            : (C) 2006 BoonEx Group
*     website              : http://www.boonex.com/
* This file is part of Dolphin - Smart Community Builder
*
* Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License.
* http://creativecommons.org/licenses/by/3.0/
*
* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the Creative Commons Attribution 3.0 License for more details.
* You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin,
* see license.txt file; if not, write to marketing@boonex.com
***************************************************************************/

require_once( 'inc/header.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'prof.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'sdating.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'images.inc.php' );


require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolEvents2.php' );

// --------------- page variables and login

$_page['name_index'] = 55;
$_page['css_name'] = 'sdating.css';
$_page['extra_css'] = $oTemplConfig -> sCalendarCss;
$_page['extra_js'] = $oTemplConfig -> sTinyMceEditorJS;

check_logged();

$_page['header'] = _t("_sdating_h");
$_page['header_text'] = _t("_sdating_h");

$oEvents = new BxDolEvents();
if ($logged['admin'])
$oEvents->bAdminMode = TRUE;

$_ni = $_page['name_index'];
$_page_cont[$_ni]['page_main_code'] = PageCompPageMainCode();

function PageCompPageMainCode() {
global $oEvents;
$bEventCreating = (getParam('enable_event_creating') == 'on');
$sRetHtml = '';
$sRetHtml .= $oEvents -> PrintCommandForms();

switch ( $_REQUEST['action'] ) {
//print functions
case 'show':
$sRetHtml .= $oEvents->PageSDatingShowEvents();
break;
case 'show_info':
$sRetHtml .= $oEvents->PageSDatingShowInfo();
break;
case 'show_part':
$sRetHtml .= $oEvents->PageSDatingShowParticipants();
break;
case 'search':
$sRetHtml .= $oEvents->PageSDatingShowForm();
$sRetHtml .= $oEvents->PageSDatingShowEvents();
break;
case 'search_by_tag':
$sRetHtml .= $oEvents->ShowSearchResult();
break;
case 'calendar':
$sRetHtml .= $oEvents->PageSDatingCalendar();
break;

/*case 'select_match':
$sRetHtml .= $oEvents->PageSDatingSelectMatches();
break;*/

//forms of editing
case 'new':
if ($bEventCreating) {
if (isset($_POST['event_save'])) {
$aPostAdv = $oEvents -> FillPostEventArrByPostValues();
$aErr = $oEvents -> CheckEventErrors( $aPostAdv );
if( empty( $aErr ) ) {
$add_res = $oEvents->SDAddEvent();
$_REQUEST['event_id'] = mysql_insert_id($GLOBALS['MySQL']->link);
$sRetHtml .= $oEvents->PageSDatingShowInfo();
} else {
$sRetHtml .= $oEvents->PageSDatingNewEventForm(-1, $aErr);
}
} else {
$sRetHtml .= $oEvents->PageSDatingNewEventForm(-1);
}
} else
$sRetHtml .= '';
break;
case 'edit_event':
$iEventID = (int)($_POST['EditEventID']);
$sRetHtml .= $oEvents->PageSDatingNewEventForm($iEventID);
break;

//non safe functions
case 'event_save':
$iEventID = (int)($_POST['EditedEventID']);
$aPostAdv = $oEvents -> FillPostEventArrByPostValues();
$aErr = $oEvents -> CheckEventErrors( $aPostAdv );
if( empty( $aErr ) ) {
$add_res = $oEvents->SDAddEvent($iEventID);//like update
$_REQUEST['event_id'] = $iEventID;
$sRetHtml .= $oEvents->PageSDatingShowInfo();
} else {
$sRetHtml .= $oEvents->PageSDatingNewEventForm($iEventID, $aErr);
}
break;
case 'delete_event':
$sRetHtml .= $oEvents->PageSDatingDeleteEvent();
$sRetHtml .= $oEvents->PageSDatingShowEvents();
break;
default:
$sRetHtml .= $oEvents->PageSDatingShowEvents();
}
return $sRetHtml;
}

PageCode();

?>

Quote · 18 Jul 2009

I'd have to see the code of the 2nd file also.  I just attempted to replicate what your doing, created both files and reuploaded them, adding your code to the events2.php file, just to make sure I had it all correct and received this error:

 

Fatal error: Cannot redeclare geteventdetails() (previously declared in /home/tbcsi1/public_html/inc/classes/BxDolEvents.php:2374) in /home/tbcsi1/public_html/inc/classes/BxDolEvents2.php on line 2382

 

 

 

So you can see, there is more going on here, as your attempting recreate the events from what the script can tell and it's not going to allow it.  Are you using exactly the same code from BxDolEvents.php in BxDolEvents2.php  ? 

 

 

Quote · 18 Jul 2009

Yes i am using the same script I have not changed the script within the BxDolEvents2.php file. But I am not getting the error your grtting i am just getting a blank page.

Quote · 18 Jul 2009

 

Yes I have not changed the script within the BxDolEvents2.php file. But I am not getting the error your grtting i am just getting a blank page.

 Are you logged into your site when you attempt to go to the URL?  Also, how do you have it set to notify of errors?  If you have it set to not show errors to members/visitors then you probably won't see it, I forget where that is on the server. 

 

I have several mods on my site so I went back and grabbed a fresh copy of BxDolEvents.php and uploaded that as BxDolEvents2.php to my server and reran the scenario.  This was the best way to get around my modifications, it cleared the one error using the clean files, howeer it threw this error:

 

Fatal error: Cannot redeclare class BxDolEvents in /home/tbcsi1/public_html/inc/classes/BxDolEvents2.php on line 16

 

I looked in the file and here is the string:

 

class BxDolEvents {
 //variables

 //count of events per page
 var $iEventsPerPage; // count of events to show per page

 //max sizes of pictures for resizing during upload
 var $iIconSize;
 var $iThumbSize;
 var $iImgSize;

 //admin mode, can All actions
 var $bAdminMode;

 //path to image pic_not_avail.gif
 var $sPicNotAvail;
 //path to spacer image
 var $sSpacerPath;

 var $iLastInsertedID = -1;

 //use permalink
 var $bUseFriendlyLinks;

 /**
  * constructor
  */
 function BxDolEvents($bAdmMode = FALSE) {
  global $site;

  $this->sSpacerPath = getTemplateIcon( 'spacer.gif' );
  $this->sPicNotAvail = 'images/icons/group_no_pic.gif';
  $this->bAdminMode = $bAdmMode;

  $this->iEventsPerPage = 10;

  $this->iIconSize = 45;
  $this->iThumbSize = 110;
  $this->iImgSize = 340;

  $this->bUseFriendlyLinks = getParam('permalinks_events') == 'on' ? true : false;
 }

Note how many times it's referring to BxDolEvents within that code alone, this will continue through as you fix one area and then send it to the next.  You will need to create css for this, new language keys, change all the BxDolEvents to BxDolEvents2 and so on.  Basically, the script will need to quit referring to events and instead refer to Events2 as if it's a completely seperate item within your site.

My suggestion, get out the Notepad++ and use the search/replace function on it, make a list of all files called and start working with them until you get it to work correctly.

Now, on the good side, if I adjust events2.php to call BxDolEvents.php instead of BxDolEvents2.php then this does work.  The issue is your simply asking it to do all the work twice because your files are identical on BxDolEventss.php & BxDolEvents2.php

Have fun with this, it's going to take you a few hours, but you should get what you want when your done, and be prepared to check every section and hunt bugs.

Quote · 18 Jul 2009

This just seems like too much work. I will look on expertzzz.com for a mod that migh suite but i doubt it.

Quote · 18 Jul 2009

 

This just seems like too much work. I will look on expertzzz.com for a mod that migh suite but i doubt it.

 What do you want it to do?  Might be able to direct you to the correct item, but keep in mind, those mods are going to modify the current events, if your looking for a completely 2nd section, then that may take customization no matter what.  Besides, I'm curious as to what you want now.

Quote · 18 Jul 2009

You can solve the problem by making three code changes but it would be better if you tell us what you are trying to achieve so we can advise you as to whether your approach is OK or not.

Here are the three changes needed :

a) In events2.php

--------------------------------------------------------------

Find :

$oEvents = new BxDolEvents();

Replace with :

$oEvents = new BxDolEvents2();

b) In BxDolEvents2.php

---------------------------------------------------------------

Find :

class BxDolEvents {

Replace with :

class BxDolEvents2 {

c) In BxDolEvents2.php

---------------------------------------------------------------

Find :

function BxDolEvents($bAdmMode = FALSE) {

Replace with :

function BxDolEvents2($bAdmMode = FALSE) {

By making the changes above, you have given the BxDolEvents class a different name. This is necessary because you cannot have more than one classes with the same name.

Quote · 31 Jul 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.