1
playsome
Re: Talk of JQuery Mobile Framework For Xoops
  • 2012/10/24 13:25

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Ive not really had a look at jquery mobile yet, but can't we just build responsive themes using media queries without the need for frameworks.?



2
playsome
[SOLVED]xoRewriteModule hack not working after upgrade to php 5.3.17
  • 2012/10/24 13:13

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


easiest fix ever. After a quick search of google it seems that indentation can sometimes casue the end of line errors. So in xoRewriteModule.ini.php line 13 where it has
[xoRewriteModule]
there was a indentation of one space, simply deleted that space and everything seems tio work now, no errors at all.

Not sure how it works but it works, hope this can help anyone else with similar problems.




3
playsome
xoRewriteModule hack not working after upgrade to php 5.3.17
  • 2012/10/24 12:54

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hi all,

my host(surpass) has upgraded php to 5.3.17 and it seems to have made the xorewriteModule hack not work.

It seems to be the rewriting of the urls to remove the /modules/ part that is not working e.g <{$xoAppUrl /modules/article/}> in the theme should point to sitename.com/news/ but it points to sitename.com/modules/article/.

I can still manually type in sitename.com/news/ and it will work fine, but the rewriting has stopped working.

I have turned on xoops debug and i get the following 6 errors:

Warningsyntax errorunexpected END_OF_LINEexpecting '=' in /configs/xoRewriteModule.ini.php on line 14 in file /Frameworks/smarty/xoSmartyFunctions.php line 32
Warning
array_key_exists() expects parameter 2 to be array, boolean given in file /Frameworks/smarty/xoSmartyFunctions.php line 34
Warning
XoSmartyPlugin section [xoRewriteModuledoes not exist in /configs/xoRewriteModule.ini.php in file /Frameworks/smarty/xoSmartyFunctions.php line 42
Warning
syntax errorunexpected END_OF_LINEexpecting '=' in /configs/xoRewriteModule.ini.php on line 14 in file /Frameworks/smarty/xoSmartyFunctions.php line 32
Warning
array_key_exists() expects parameter 2 to be array, boolean given in file /Frameworks/smarty/xoSmartyFunctions.php line 34
Warning
XoSmartyPlugin section [xoRewriteModuledoes not exist in /configs/xoRewriteModule.ini.php in file /Frameworks/smarty/xoSmartyFunctions.php line 42


this is the code in xoRewriteModule.ini.php
<?php
/**
 * -------------------------------------------------------------------------------------
 * Smarty plugin for xoops
 * xoRewriteModule configuration file
 *
 * Author:                : DuGris <http://www.dugris.info>
 * -------------------------------------------------------------------------------------
 * xoRewriteModule    : Url rewritting for modules/dirname
 * -------------------------------------------------------------------------------------
 */
 
 
[xoRewriteModule]
 
article="news"
 
xcgal="photo-gallery"
 
qpages="whats-on"
 
smartpartner="partners"
 
extcal="calendar"
 
content="services"
 
room-hire="room-hire"
 
wfchannel="about-us"
 
mastop_go2="spotlight"
 
mysearch="wcrcsearch"
 
g-teas-cafe="g-teas-cafe"
 
sitemap="sitemap"
 
docs="docs"
 
tag="tags"
 
links="links"
 
profile="profile"
 
pm="pm"
 
contact="contactform"
 
newbb="forums"
 
tips-for-saving-energy="top-tips-for-saving-energy"
 
weblog="blogs"
 
outofschoolcare="bonusballoutofschoolcare"
 

?>


this is the code in Frameworks/smarty/xoSmartyFunctions.php

<?php
/**
 * -------------------------------------------------------------------------------------
 * Common functions for Xoops's smarty plugins : xoSmartyFunctions.php
 *
 * Type            : common functions
 * Author:        : DuGris <http://www.dugris.info>
 * Purpose        : Common functions for Xoops's smarty plugins
 * -------------------------------------------------------------------------------------
**/

define("XOSMARTY_FILENOTFOUND""XoSmartyPlugin : %s does not exist");
define("XOSMARTY_SECTIONNOTFOUND""XoSmartyPlugin : section [%s] does not exist in %s");
define("XOSMARTY_GDNOTINSTALLED""XoSmartyPlugin : GD Librairy is not installed");
define("XOSMARTY_DEFAULTVALUE""XoSmartyPlugin : %s use the default values");

/**
 * -------------------------------------------------------------------------------------
 * get the contents of the section of ini file :
 *
 * @param        String        $section            name of the section of ini file
 *
 * @return        Array
 * -------------------------------------------------------------------------------------
**/
function XoSmartyPluginGetSection$section '' ) {
    
$config_file 'xoSmartyPlugin';
    if ( 
file_existsXOOPS_ROOT_PATH "/configs/$section.ini.php" ) ) {
        
$config_file $section;
    }
    if ( 
file_existsXOOPS_ROOT_PATH "/configs/$config_file.ini.php" ) ) {
        
$IniContent parse_ini_fileXOOPS_ROOT_PATH "/configs/$config_file.ini.php"true);
        if ( !empty(
$section) ) {
            if ( 
array_key_exists$section$IniContent) ) {
                if ( 
count($IniContent[$section]) == ) {
                     
XoopsErrorHandler_HandleErrorE_USER_WARNINGsprintf(XOSMARTY_SECTIONNOTFOUND$section"/configs/$config_file.ini.php"), __FILE____LINE__ );
                    return array();
                }
                return 
$IniContent[$section];
            }
        }
         
XoopsErrorHandler_HandleErrorE_USER_WARNINGsprintf(XOSMARTY_SECTIONNOTFOUND$section"/configs/$config_file.ini.php"), __FILE____LINE__ );
        return 
$IniContent;
    }
    
XoopsErrorHandler_HandleErrorE_USER_WARNINGsprintf(XOSMARTY_FILENOTFOUND"/configs/$section.ini.php") , __FILE____LINE__ );
    return array();
}

/**
 * -------------------------------------------------------------------------------------
 * Check if the GD Librairy is installed
 *
 * @return        Boolean        TRUE if GD Librairy is installed, FALSE otherwise
 * -------------------------------------------------------------------------------------
**/
function XoSmartyPluginLoadGD() {
    if (
extension_loaded('gd')) {
        
$required_functions = array("imagecreate""imagecreatetruecolor""imagecolorallocate""imagefilledrectangle""ImagePNG""imagedestroy""imageftbbox""ImageColorTransparent");
        foreach(
$required_functions as $func) {
            if( !
function_exists($func) ) {
                
XoopsErrorHandler_HandleErrorE_USER_WARNINGXOSMARTY_GDNOTINSTALLED __FILE____LINE__ );
                return 
false;
            }
        }
    }
    return 
true;
}

/**
 * -------------------------------------------------------------------------------------
 * Convert Hexacimal color in RGB color
 *
 * @param        String        $color        hexacimal color
 *
 * @return        Array            {0 => red color value, 1 => green color value, 2 => blue color value)
 * -------------------------------------------------------------------------------------
**/

function XoSmartyPluginHTML2RGB$color '#000000' ) {
    if (
substr($color,0,1)=="#"$color=substr($color,1,6);

    
$ret[0] = hexdec(substr($color02));
    
$ret[1] = hexdec(substr($color22));
    
$ret[2] = hexdec(substr($color42));
    return 
$ret;
}

/**
 * -------------------------------------------------------------------------------------
 * Truncate string
 *
 * @param        string        $string            string to truncate
 * @param        int            $length            determines how many characters to truncate to.
 * @param        string        $etc                replace the truncated text
 * @param        boolean        $break_words    determines whether or not to truncate at a word boundary
 * @param        boolean        $middle            determines whether the truncation happens at the end of the string
 *
 * @return        String
 * -------------------------------------------------------------------------------------
**/
function XoSmartyPlugin_truncate($string$length 80$etc '...'$break_words false$middle false) {
    if ( 
$length == ) {
        return 
'';
    }

    if ( 
strlen($string) > $length ) {
        
$length -= min($lengthstrlen($etc));
        if ( !
$break_words && !$middle ) {
            
$string preg_replace('/s+?(S+)?$/'''substr($string0$length+1));
        }
        if ( !
$middle ) {
            return 
substr($string0$length) . $etc;
        } else {
            return 
substr($string0$length/2) . $etc substr($string, -$length/2);
        }
    } else {
        return 
$string;
    }
}

function 
XoSmartyPlugin_write_index_file$path '') {
    if ( empty(
$path) ) { return false; }

    
$path substr($path, -1) == "/" substr($path0, -1) : $path;
    
$filename $path '/index.html';

    if ( 
file_exists($filename) ) { return true; }

    if ( !
$file fopen($filename"w") ) {
        echo 
'failed open file';
        return 
false;
    }
    if ( 
fwrite($file"<script>history.go(-1);</script>") == -) {
        echo 
'failed write file';
        return 
false;
    }
    
fclose($file);
    return 
true;
}
?>


Any ideas to what has changed in php 5.3.17 that could be casuing these errors and the rewrite hack not to work?

Thanks for your help.



4
playsome
Re: Shorter URLs
  • 2012/9/25 12:00

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Quote:

deka87 wrote:
there is a xoRewriteURL hack that I've been using forever with all xoops versions since xoops 2.2. you can go from site.com/modules/newbb/ to site.com/forums/, from site.com/modules/catads to site.com/ads and so on, it works with any module


Yes, xoRewriteModule hack is one of the best, lets you remove /modules/ part of the URL as well as rename modules. Link to the forum post about it https://xoops.org/modules/newbb/viewtopic.php?start=0&topic_id=68613&viewmode=flat&order=ASC&type=&mode=0



5
playsome
Re: Starting a Content/News Module Development Team
  • 2012/9/20 21:11

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Mamba has emailed me his version of article (phppp module) using 2.5 gui, I have still to test it, but in my oppinion basing any new news module on article can only be a positiive thing.

having read the posts above I will agree that the switching from admin to user side when doing category/article management is confusing and should be confined to admin side, article module also lets you post articles via user side which is good and should be retained, for example I have inexperiences staff who can post articles so not letting them near admin side is a good thing.

I think also that any work on this module should be clearly defined as a news or blog module and not a content module, when I think content, I think static content like creating pages that are not going to change very often, news or blog module should be seperate from a content module. A news module should solely be for articles, content module should be a seperate entiity dealing with more static pages.



6
playsome
Re: eXtCal 2.37 Beta 4, will this ever get out of beta?
  • 2012/9/6 11:21

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Thanks for your help anyway Mamba, I realise people are busy with other things.

It is frustrating, from a xoops end user point of view to see great modules with potential seemingly sitting in beta stage forever. There are loads of great xoops devs out there who are, IMO, genuises with php code. Maybe core devs could take time off from the core and get some modules, like extcal finished, bug fixed, etc and released as as stable, final versions.

Or perhaps great devs like wishcraft, could take this module under his wing and complete it.

Ive said time and time again, the xoops core is nothing without great modules to run on it, there are great modules out there but there needs to be more and these need to be stable and not beta or RC.



7
playsome
Re: eXtCal 2.37 Beta 4, will this ever get out of beta?
  • 2012/9/4 22:15

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Bumping, does no one know how to fix these issues I have mentioned?



8
playsome
Re: eXtCal 2.37 Beta 4, will this ever get out of beta?
  • 2012/9/2 16:36

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Quote:

Mazarin wrote:
It should be a matter of assigning values to the non-working variables just as you did with the one you fixed.


Hi, thanks for your reply. By assign values do you mean $xoopsTpl->assign('value', $variable);? If so I have tried this but doesnt seem to work.

I tried similar to what I did with view_calendar-week.php for other templates but I couldnt get event start times to show. PHP coding is not my strong point im afraid.

On the templates where I could get no start time to show(view_week, etc) I ran smarty debug, this shows the array that holds all the event data and formated_event_start and formated_event_end where showing as empty but in the templates where it does work the value in the array shows the formated date.

So I am thinking that on execution of the PHP script the value for the formated_event_start/end isnt being passed into the event array? Just a guess, probably wrong. I could look at the php code from now til doomsday and not figure out whats going on,so Im hoping from some assistance from a xoops guru.

As for the recurring events in the block, not sure this has been a bug since the original extcal module.

I am hoping this version of extcal will get finsihed and not just left to sit in beta or RC state forever like so many other decent xoops modules.

Thanks



9
playsome
Re: eXtCal 2.37 Beta 4, will this ever get out of beta?
  • 2012/9/2 12:40

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


just found and fixed another issue.

On view_week.php the navig data for showing current, previous and next week was not showing, was only showing << >>.

In view_week.php line 83 to 95 remove the $navig array and replace with
$navig = array(
    
'prev'
    
=> array(
        
'uri'
        
=> 'year=' $pWeekCalObj->thisYear() . '&amp;month='
            
$pWeekCalObj->thisMonth() . '&amp;day='
            
$pWeekCalObj->thisDay(), 'name' => $extcalTimeHandler->getFormatedDate($xoopsModuleConfig['nav_date_week'], $pWeekCalObj->getTimestamp())
    ), 
'this'
    
=> array(
        
'uri'
        
=> 'year=' $weekCalObj->thisYear() . '&amp;month='
            
$weekCalObj->thisMonth() . '&amp;day='
            
$weekCalObj->thisDay(), 'name' => $extcalTimeHandler->getFormatedDate($xoopsModuleConfig['nav_date_week'], $weekCalObj->getTimestamp())
    ), 
'next'
    
=> array(
        
'uri'
        
=> 'year=' $nWeekCalObj->thisYear() . '&amp;month='
            
$nWeekCalObj->thisMonth() . '&amp;day='
            
$nWeekCalObj->thisDay(), 'name' => $extcalTimeHandler->getFormatedDate($xoopsModuleConfig['nav_date_week'], $nWeekCalObj->getTimestamp())
    )
);


This is the navig array copied from view_calender-week.php, im not sure what the difference is but it seems to work.



10
playsome
Re: eXtCal 2.37 Beta 4, will this ever get out of beta?
  • 2012/9/2 12:09

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


I think I may have fixed the problem with the event start/end time/date not showing on view_calendar_week view

in view_calendar-week.php line 62 to

I have added the line

$eventHandler->formatEventDate($event$xoopsModuleConfig['event_date_week']);


directly underneath the for each loop so line 62 to 65 now looks like this
$eventsArray = array();
foreach (
$events as $event) {
    
$eventHandler->formatEventDate($event$xoopsModuleConfig['event_date_week']);
        
$eventHandler->addEventToCalArray($event$eventsArray$startWeek$endWeek);


event start date now shows on view_calendar-week still need to get the event start date/time to show for the other tempaltes i mentioned above.




TopTop
(1) 2 3 4 ... 17 »



Login

Who's Online

167 user(s) are online (110 user(s) are browsing Support Forums)


Members: 0


Guests: 167


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits