Web CMS Designs: Forums
 

 
Post new topic Reply to topic
Message
Display posts from previous:       
PostPosted: Sun Sep 23, 2012 3:05 pm
Reply with quote Back to top
gator81
Newbie
Newbie
Joined: Sep 02, 2012
Posts: 37

View user's profile Send private message
I know you have probally seen post on other sites, and I have been able to get different answeres and I will still be researching and experminting to see if i can get lucky.

can you convert a module to run as a complete block to avoid the rules of a module posted for the home.

and sorry to ask one more

Is there a way to change the rule to allow two different modules on home page.
 
PostPosted: Mon Sep 24, 2012 1:34 am
Reply with quote Back to top
spasticdonkey
Newbie
Newbie
Joined: Nov 18, 2010
Posts: 106
Location: Texas

View user's profile Send private message Visit poster's website
I will say you have chosen one of the more difficult modules to try to port to a block. Just the number of files used by the module could spawn into considerable work. Just working off the advice others have given to this point, you might have something like below. Note that this will not work (yet) but is a starting point. I have commented out the printable view as it won't be viewed that way within a block. This will produce some errors which I will touch on below.

php Code:
<?php


if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}

$calendar_name = 'GCalendar';
require_once 'modules/' . $calendar_name . '/language.php';
gcalGetLang($calendar_name);

require_once 'modules/' . $calendar_name . '/viewmonth.php';
// require_once 'modules/' . $calendar_name . '/printable.php';

// if (isset($printable)) {
// $printable = true;
// printableHeader();
// } else {
// $printable = false;
// include 'header.php';
// OpenTable();
// }
$printable = false;
$y = isset($y) ? $y : 0;
$m = isset($m) ? $m : 0;
viewMonth($y, $m, $printable);
?>

You run into problems because viewmonth.php includes a bunch of other files and uses the
global $module_name
which in your case would probably return "News", when it should be looking for "GCalendar".
php Code:
global $module_name;

require_once 'modules/' . $module_name . '/gcal.inc.php';
require_once 'modules/' . $module_name . '/class.combo.php';
require_once 'modules/' . $module_name . '/common.inc.php';
require_once 'modules/' . $module_name . '/getMonthlyEvents.php';
require_once 'modules/' . $module_name . '/displayCatLegend.php';
require_once 'modules/' . $module_name . '/formatEvents.php';

I would comment out
global $module_name
and add
$calendar_name = 'GCalendar';
, then replace all instances of
$module_name
with
$calendar_name
.
php Code:
//global $module_name;

$calendar_name = 'GCalendar';
require_once 'modules/' . $calendar_name . '/gcal.inc.php';
require_once 'modules/' . $calendar_name . '/class.combo.php';
require_once 'modules/' . $calendar_name . '/common.inc.php';
require_once 'modules/' . $calendar_name . '/getMonthlyEvents.php';
require_once 'modules/' . $calendar_name . '/displayCatLegend.php';
require_once 'modules/' . $calendar_name . '/formatEvents.php';

You would then need to go thru all those included files (gcal.inc.php,class.combo.php,etc..), and any files included by those files (within the module) and look for similar issues. That should get you started, but with the nature of these changes you should be testing with error reporting on (root/config.php) which means you should be testing locally using WAMP or similar. http://www.wampserver.com/en/

As for running 2 modules at once, that would cause too many issues throughout the CMS.
spasticdonkeywebcmsdesigns
 
PostPosted: Mon Sep 24, 2012 5:57 am
Reply with quote Back to top
gator81
Newbie
Newbie
Joined: Sep 02, 2012
Posts: 37

View user's profile Send private message
thank you, this gives me a starting point.

I do work first with xampp or wampserver. nextgen has been a really big help with the wampserver and it is fast Smile but i couldnt get wimpy to work right with it so I have been testing with both of them when i can Smile

as a follow up, i only see 10 files that have something to do with modules and most of them are directing to links. And out of those 10 off top of my head there are 2 that direct to the mainfile.php

I will try to start with what you show me and see what kinda progress I can make and let you know my results

thank you for your help.
 
PostPosted: Mon Sep 24, 2012 7:11 am
Reply with quote Back to top
spasticdonkey
Newbie
Newbie
Joined: Nov 18, 2010
Posts: 106
Location: Texas

View user's profile Send private message Visit poster's website
fkelly also had a good suggestion on Raven's site that would be alot less work...
http://www.ravenphpscripts.com/postp160176.html#160176
spasticdonkeywebcmsdesigns
 
PostPosted: Mon Sep 24, 2012 9:45 am
Reply with quote Back to top
gator81
Newbie
Newbie
Joined: Sep 02, 2012
Posts: 37

View user's profile Send private message
I had just finished the changes you requested and all I have to finish is to define as a block file. So far the debug is showing no errors for the rest of the changes.
with everything far do i need to copy the gcalendar to the blocks folder? this way the admin will see it as a block and I can add the block ?

As for the link, I had tried something simular to that and the site looked very empty. To be honest if I was going to use blocks to link to everything then it would be no different then using the calander to link to the calendar module?
I think its a great idea if I have no other choices. I also believe that if I can get this working with your help it will be used alot more then people have said.

I am truly greatfull for your help, and I am excited about the chance to make this work.
 
PostPosted: Mon Sep 24, 2012 11:24 am
Reply with quote Back to top
spasticdonkey
Newbie
Newbie
Joined: Nov 18, 2010
Posts: 106
Location: Texas

View user's profile Send private message Visit poster's website
You do not need to, nor should you, copy any gcalendar files to the blocks folder. You should be able to take this example from above, and save as a block file.
php Code:
<?php


if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}

$calendar_name = 'GCalendar';
require_once 'modules/' . $calendar_name . '/language.php';
gcalGetLang($calendar_name);

require_once 'modules/' . $calendar_name . '/viewmonth.php';
// require_once 'modules/' . $calendar_name . '/printable.php';

// if (isset($printable)) {
// $printable = true;
// printableHeader();
// } else {
// $printable = false;
// include 'header.php';
// OpenTable();
// }
$printable = false;
$y = isset($y) ? $y : 0;
$m = isset($m) ? $m : 0;
viewMonth($y, $m, $printable);
?>

For instance, you could save as blocks/block-Calendar.php and upload to the same location on your site. The go to create block and select your block from the filename menu, and set as a center block in your desired location.
spasticdonkeywebcmsdesigns
 
PostPosted: Mon Sep 24, 2012 1:29 pm
Reply with quote Back to top
gator81
Newbie
Newbie
Joined: Sep 02, 2012
Posts: 37

View user's profile Send private message
the example didnt seem to work, i was getting an error so i went and looked the the other blocks and I used this for blocks-calendar.php
Code:
<?php


if (!defined('BLOCK_FILE'))
{
   Header('Location: ../index.php');
   die();
}


?>

then the box came up but it would just have the statement "There isn't content right now for this block."
I tried a couple of times to edit the gcalendar blocks and for
$modname = 'GCalendar'; i changed to $modname = 'Calendar'; and after i did that the debug was catching errors with these files.
Code:
require_once 'modules/' . $modName . '/language.php';

gcalGetLang($modName);
require_once 'modules/' . $modName . '/gcal.inc.php';
require_once 'modules/' . $modName . '/common.inc.php';
require_once 'modules/' . $modName . '/getMonthlyEvents.php';
require_once 'modules/' . $modName . '/gcalBlock.php';

It would only say it couldnt find the language.php file. I tried for fun to comment out the first to lines and then i got the error for the next one gcal.inc.php

thanks for the help
 
PostPosted: Mon Sep 24, 2012 4:28 pm
Reply with quote Back to top
gator81
Newbie
Newbie
Joined: Sep 02, 2012
Posts: 37

View user's profile Send private message
well I wanted to let you know that I have found someone who has made the changes to convert it to a block. As of right now its probally 90% complete an as soon as its complete I will post the changes for review and to share. Thank you for helping me get started to do this.
 
PostPosted: Tue Sep 25, 2012 6:40 am
Reply with quote Back to top
gator81
Newbie
Newbie
Joined: Sep 02, 2012
Posts: 37

View user's profile Send private message
I was fortunate enough to get a responce from user Noto at clanthemes that did this with little edit or problems. I posted this on RN site too but wanted to just post the whole thing here too.

This is a fix that I seems to work, and the nice thing about this is you dont have to really do that much. I was able to get this fix from Noto over at clanthemes.com

In your GCalendar folder open viewmonth.php
Find
Code:
global $module_name; 

require_once 'modules/' . $module_name . '/gcal.inc.php';
require_once 'modules/' . $module_name . '/class.combo.php';
require_once 'modules/' . $module_name . '/common.inc.php';
require_once 'modules/' . $module_name . '/getMonthlyEvents.php';
require_once 'modules/' . $module_name . '/displayCatLegend.php';
require_once 'modules/' . $module_name . '/formatEvents.php';

Replace with
Code:
// global $module_name; 

// require_once 'modules/' . $module_name . '/gcal.inc.php';
// require_once 'modules/' . $module_name . '/class.combo.php';
// require_once 'modules/' . $module_name . '/common.inc.php';
// require_once 'modules/' . $module_name . '/getMonthlyEvents.php';
// require_once 'modules/' . $module_name . '/displayCatLegend.php';
// require_once 'modules/' . $module_name . '/formatEvents.php';

// Noto mod
$CalPath = 'GCalendar';
require_once 'modules/' . $CalPath . '/gcal.inc.php';
require_once 'modules/' . $CalPath . '/class.combo.php';
require_once 'modules/' . $CalPath . '/common.inc.php';
require_once 'modules/' . $CalPath . '/getMonthlyEvents.php';
require_once 'modules/' . $CalPath . '/displayCatLegend.php';
require_once 'modules/' . $CalPath . '/formatEvents.php';


create a block file block-GCalendar_Module.php or whatever you want to name it and put this information in there.
Code:
<?php 


// Noto mod

if ( !defined('BLOCK_FILE') ) {
   Header('Location: ../index.php');
   die();
}

ob_start();

$CalPath = 'GCalendar';

require_once 'modules/' . $CalPath . '/language.php';
gcalGetLang($CalPath);

require_once 'modules/' . $CalPath . '/viewmonth.php';
require_once 'modules/' . $CalPath . '/printable.php';

$y = isset($y) ? $y : 0;
$m = isset($m) ? $m : 0;
viewMonth($y, $m, $printable);


$output = ob_get_contents();
ob_end_clean();
$content = $output;

$content .= '<script type="text/javascript" src="modules/' . $CalPath . '/displayCatLegend.js"></script>';

?>


they said the only problem was width and this was resolved by making the todays date two lines instead of one.
modules/GCalendar/common.inc.php
Find
Code:
echo '<td align="left" valign="middle" width="31%"><span class="thick">' . _HEADER_TODAYS_DATE . '</span> ' . $gotoToday . "</td>\n";

Replace with
Code:
echo '<td align="left" valign="middle" width="31%"><span class="thick">' . _HEADER_TODAYS_DATE . '</span><br />' . $gotoToday . "</td>\n";


at last they said you might get a conflict if you have the side block or any other block to do with GCalendar active, they didn't feel the need to check.

again I want to thank Noto over at clanthemes.com for this easy fix.

If you also notice this was pretty much the same directions that you were helping me with.
 
PostPosted: Wed Sep 26, 2012 12:22 am
Reply with quote Back to top
spasticdonkey
Newbie
Newbie
Joined: Nov 18, 2010
Posts: 106
Location: Texas

View user's profile Send private message Visit poster's website
Glad you were able to find something that worked for you, and thanks for sharing your progress. Wink
spasticdonkeywebcmsdesigns
 
Post new topic Reply to topic Web CMS Designs Forum Index Coding Discussion PHP
Your AccountNew Members
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2008 phpBB Group
 
 
Code Authors