1
belia
myreferer & uservisit module with preloads xoops 2.4?
  • 2010/1/1 16:32

  • belia

  • Just popping in

  • Posts: 83

  • Since: 2007/12/18


I'm using this module in my site..both module are great for user tracking ...credit to solo71


myreferer 2.0
https://xoops.org/modules/newbb/viewtopic.php?post_id=293260#forumpost293260


uservisit 2.3
http://www.arma-sa.com/modules/mydownloads/singlefile.php?cid=3&lid=13


how to edit this module to use preloads which exist in XOOPS 2.4xx?

right now we have to edit footer.php & header.php to insert some line to make both of this module to work

so evrytime we make core upgrade we have to insert this line..







2
Dylian
Re: myreferer & uservisit module with preloads xoops 2.4?
  • 2010/1/1 18:01

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


For myReferer create a file in myreferer/preloads/ named header.php (or something else, just what you like...)

And put this in it:
<?php
defined
('XOOPS_ROOT_PATH') or die('Restricted access'); 

class 
myRefererCorePreload extends XoopsPreloadItem
    function 
eventCoreHeaderStart(){ 
        global 
$xoopsDB$xoopsUser;
        include(
XOOPS_ROOT_PATH.'/modules/myReferer/record.php');
    } 

?>


And for uservisit create a file in uservisit/preloads/ named footer.php (or something else ofcourse)

And put this in it:
<?php
defined
('XOOPS_ROOT_PATH') or die('Restricted access'); 

class 
UservisitCorePreload extends XoopsPreloadItem
    function 
eventCoreFooterStart(){ 
        include(
XOOPS_ROOT_PATH."/modules/uservisit/index.php");
    } 

?>


Greets Dylian.

3
trabis
Re: myreferer & uservisit module with preloads xoops 2.4?
  • 2010/1/1 18:03

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


You need to add a folder call 'preloads' and create a file inside called 'core.php' for each of those modules.

Inside myReferer/preloads/core.php use:
<?php
class MyRefererCorePreload extends XoopsPreloadItem
{
    function 
eventCoreHeaderStart($args)
    {
        include 
XOOPS_ROOT_PATH '/modules/myReferer/record.php';
    }

}
?>


Inside uservisit/preloads/core.php use:
<?php
class UservisitCorePreload extends XoopsPreloadItem
{
    function 
eventCoreFooterStart($args)
    {
        include 
XOOPS_ROOT_PATH '/modules/uservisit/index.php';
    }
}
?>


Did not test it.

[EDIT] I did not saw Dylian post, it may need the use of globals, I did not check the module code.

4
belia
Re: myreferer & uservisit module with preloads xoops 2.4?
  • 2010/1/2 1:29

  • belia

  • Just popping in

  • Posts: 83

  • Since: 2007/12/18


thank you dylian and trabis...

what i did was remove the line in header.php and footer.php

then create two folder and file both in uservisit and myreferer

clear cache update module then made some test

i got blank in some page and i can't access the admin area

enable debug through phmyadmin and edit xoopsconfig to reveal debug message to anonymous

i see this following message

Quote:


Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /modules/uservisit/preloads/footer.php:9) in file /include/common.php line 178
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /modules/uservisit/preloads/footer.php:9) in file /include/common.php line 178
Warning: Cannot modify header information - headers already sent by (output started at /modules/uservisit/preloads/footer.php:9) in file /modules/pm/preloads/core.php line 46


Quote:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /modules/myReferer/preloads/header.php:10) in file /include/common.php line 178
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /modules/myReferer/preloads/header.php:10) in file /include/common.php line 178
Warning: Cannot modify header information - headers already sent by (output started at /modules/myReferer/preloads/header.php:10) in file /modules/pm/preloads/core.php line 46

5
trabis
Re: myreferer & uservisit module with preloads xoops 2.4?
  • 2010/1/2 1:54

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Be sure you don't have extra spaces or lines after closing ?> or before <?php in the files you've created.

6
belia
Re: myreferer & uservisit module with preloads xoops 2.4?
  • 2010/1/2 4:09

  • belia

  • Just popping in

  • Posts: 83

  • Since: 2007/12/18


thank you it works !! i will send pm to solo71 to inform him about this thread








7
belia
Re: myreferer & uservisit module with preloads xoops 2.4?
  • 2010/1/4 2:16

  • belia

  • Just popping in

  • Posts: 83

  • Since: 2007/12/18


Hi

my mistake..sorry

eventhough i received no blank page.....

this is actually not working

no new statistic from both modules is received in the admin panel..since i use the preloads folder...

Help....

8
belia
Re: myreferer & uservisit module with preloads xoops 2.4?
  • 2010/1/9 0:58

  • belia

  • Just popping in

  • Posts: 83

  • Since: 2007/12/18


Bump

9
ghia
Re: myreferer & uservisit module with preloads xoops 2.4?
  • 2010/1/9 2:18

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


You did name them /preloads/core.php ?
Tested MyReferer 2.0 with XOOPS 2.43 and it seems to be working.

10
belia
Re: myreferer & uservisit module with preloads xoops 2.4?
  • 2010/1/9 4:35

  • belia

  • Just popping in

  • Posts: 83

  • Since: 2007/12/18


i named it as modules/myreferer/preloads/header.php for my referer

and modules/uservisit/preloads/footer.php

as instructed in the above post


i will try rename it as core.php and report back here changes...

tq

Login

Who's Online

204 user(s) are online (144 user(s) are browsing Support Forums)


Members: 0


Guests: 204


more...

Donat-O-Meter

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

Latest GitHub Commits