installing itemstats on phpnuke

phpNuke integration forum

installing itemstats on phpnuke

Postby rondo3000 » Wed Apr 18, 2007 6:29 am

Does anyone have any instructions on installing itemstats on phpnuke?
rondo3000
WR.net Apprentice
WR.net Apprentice
 
Posts: 11
Joined: Mon Mar 26, 2007 6:12 am

Re: installing itemstats on phpnuke

Postby natbur » Wed Apr 18, 2007 10:36 pm

I've got it working on my phpnuke site. I started with the code from http://itemstats.free.fr/ you'll need the core and the phpnuke file. However, all you need out of the phpnuke file is phpnuke_config_itemstat.php. You'll also want to create a custom_head.php in includes/custom_files
custom_head.php
Code: Select all
<?php
   include_once("phpnuke_config_itemstat.php");
   include_once(path_itemstats . "phpnuke_itemstats.php");       
   echo '<link rel="stylesheet" href="' . path_itemstats . getStrCssStyle() . '" type="text/css">
<script type="text/javascript" src="' . path_itemstats . getStrTooltipStyle() . '"><!-- overLIB (c) Erik Bosrup --></script>
';
?>

Now you need to edit the files for whichever part of nuke you want itemstats to work in.
For the forums you'll be editing includes/bbcode.php
look for
Code: Select all
      return $text;
   }
   
   // Only load the templates ONCE..

and replace with
Code: Select all
      return $text;
   }

/************************************************************************/
/*      Parse text for [Item] tags                    */
/************************************************************************/
$text = itemstats_parse($text);
   
   // Only load the templates ONCE..

For the news, there are two files for you to edit, modules/News/index.php and modules/News/article.php
in index.php find
Code: Select all
   }
   
   getTopics($s_sid);

and replace with
Code: Select all
   }
   
/************************************************************************/
/*      Parse text for [Item] tags                    */
/************************************************************************/
$hometext = itemstats_parse($hometext);
   
   getTopics($s_sid);

for articles.php find
Code: Select all
    $title = "<a href=\"modules.php?name=$module_name&amp;file=categories&amp;op=newindex&amp;catid=$catid\"><font class=\"storycat\">$title1</font></a>: $title";
}

echo "<table width=\"100%\" border=\"0\"><tr><td valign=\"top\" width=\"100%\">\n";

and replace with
Code: Select all
    $title = "<a href=\"modules.php?name=$module_name&amp;file=categories&amp;op=newindex&amp;catid=$catid\"><font class=\"storycat\">$title1</font></a>: $title";
}

/************************************************************************/
/*      Parse text for [Item] tags                    */
/************************************************************************/
$bodytext = itemstats_parse($bodytext);


echo "<table width=\"100%\" border=\"0\"><tr><td valign=\"top\" width=\"100%\">\n";


The general idea here is, anything anywhere on your page you want to have the itemstats popup needs to be run through the itemstats_parse() function. Every page on nuke will have access to this because of the custom header file.

Icon files can be downloaded from http://wow.allakhazam.com/db/guides.html?guide=502

This version of itemstats (1.5.*) has an issue that if an item is not in your item_cache then it provides a link to update item_cache instead of doing it automatically. This link only has to ever be clicked on once, but it's annoying. When I get a chance, I'll start digging through the php to fix that small, but annoying bug.

I prefer my way of implementing itemstats to others I've found out there because I find it to be the most flexible and it requires the least modification of code.

Also, if any of the above snippets aren't clear, just let me know and I'll clarify.
Last edited by natbur on Fri Apr 27, 2007 12:44 am, edited 1 time in total.
User avatar
natbur
WR.net Apprentice
WR.net Apprentice
 
Posts: 72
Joined: Fri Apr 13, 2007 12:52 pm
Location: Texas

installing itemstats on phpnuke

Postby rondo3000 » Tue Apr 24, 2007 2:26 am

Thanks for the instructions! I will let you know if it works on my site.
rondo3000
WR.net Apprentice
WR.net Apprentice
 
Posts: 11
Joined: Mon Mar 26, 2007 6:12 am

Re: installing itemstats on phpnuke

Postby Soulreaver418 » Wed May 23, 2007 2:49 am

Hi, I also am on a hunt for directions to install itemstats on a nuke site. I have followed the directions on this forum but keep getting blank page loads when i add the custom file you have described.

I at first had nuke 8, but have since downgraded to 7.9 again as it seems more stable.

I think I am going about it the right way, upload the itemstats folder to the root directory of my site.... /nuke
/itemstats
/html
/sql.. etc...
to give you an idea of the file structure. I'm not sure what the problem is, I have noticed that its not creating the item_cache table in my database even though the config.php is correctly configured with database info. i came across a page that had the actual sql query that you could run to create the table but have since lost the page :scratch: any help would be greatly appreciated.

Maybe i am putting files in the wrong place, I dunno, little frustrated atm though...
Soulreaver418
WR.net Apprentice
WR.net Apprentice
 
Posts: 6
Joined: Wed May 23, 2007 12:38 am

Re: installing itemstats on phpnuke

Postby natbur » Wed May 23, 2007 9:18 pm

I think you're uploading more than you need to, only the contents of the html directory should be uploaded. I suspect that's the main issue that you're running into. Typically, the white page means that it failed to find a required file. You can temporarily turn on display errors in the phpnuke config.php file if you want to know exactly what's going wrong.

As to the sql query, that's located in the folder called sql.
Last edited by natbur on Wed May 23, 2007 9:19 pm, edited 1 time in total.
User avatar
natbur
WR.net Apprentice
WR.net Apprentice
 
Posts: 72
Joined: Fri Apr 13, 2007 12:52 pm
Location: Texas

Re: installing itemstats on phpnuke

Postby breath » Wed Jun 27, 2007 8:14 am

i get

Fatal error: Unknown function: getstrcssstyle() in /membri/mentalcruelty/phpnuke76/html/includes/custom_files/custom_head.php on line 4

if i put the custom_head in that directory
breath
WR.net Apprentice
WR.net Apprentice
 
Posts: 1
Joined: Wed Jun 27, 2007 8:00 am

Re: installing itemstats on phpnuke

Postby Jazuz » Fri Jul 06, 2007 7:21 pm

Hi,

Info:
Phpnuke 7.9
Theme Acidred

I follow what natbur said, the itemstats on forum is working great but in the news isn't working at all :cry: , can you give me a help to see whats wrong ??

Best regards, Jazuz
Jazuz
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Fri Jul 06, 2007 7:17 pm

Re: installing itemstats on phpnuke

Postby Jazuz » Fri Jul 06, 2007 7:29 pm

Hi,

Never mind was using a different module for posting a message, working great, thx for the info natbur.

Best regards, Jazuz
Jazuz
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Fri Jul 06, 2007 7:17 pm

Re: installing itemstats on phpnuke

Postby robo456 » Sat Nov 10, 2007 7:19 am

natbur wrote:This version of itemstats (1.5.*) has an issue that if an item is not in your item_cache then it provides a link to update item_cache instead of doing it automatically. This link only has to ever be clicked on once, but it's annoying. When I get a chance, I'll start digging through the php to fix that small, but annoying bug.



Everything seems to run fine, but I'm hitting that 'bug' as well... has there ben any update to this? I tried searching around thru google to see if anyone had an item_cache dump, but the only one I could find was old. Thanks for any info!!

--rob

***EDIT***
I found this on the eqdkp forums:

edit config_itemstats.php

find

Code: Select all
define('automatic_search', false);


change to

Code: Select all
define('automatic_search', true);


Works like a champ with 1.5.5 and forums in PHPNuke 7.5!
Last edited by robo456 on Sat Nov 10, 2007 7:38 am, edited 2 times in total.
robo456
WR.net Apprentice
WR.net Apprentice
 
Posts: 1
Joined: Thu Aug 03, 2006 12:14 am

installing itemstats on phpnuke

Postby Freeboota » Tue Jun 03, 2008 8:45 pm

Sorry to dig up an old thread but this was the most informative thread I could find on this subject.

I followed the steps set out above and it worked a treat! everything seems to work just fine on the forums. However the news doesn't work. I changed the code on both the files as above but when I link an item it sits there as if it isn't cached, even after clicking it it still wont display.

Does anyone have any ideas for me?
Freeboota
WR.net Apprentice
WR.net Apprentice
 
Posts: 1
Joined: Tue Jun 03, 2008 8:31 pm


Return to phpNuke

Who is online

Users browsing this forum: Bing [Bot] and 0 guests

cron