TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 629
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 513
  • Total: 513

eqdkp latest loot

Started by baderick, May 09, 2007, 12:34:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

laric

Ok updated it a little to be a bit prettier.


include_once("/localpathto/itemstats/smf_itemstats.php");

// db config

$linkmoreloot = '';
$DBhost = 'localhost';
$DBuser = 'xxx';
$DBpass = 'xxx';
$DBName = 'xxx';
$limit = 10;
$eqdkp_prefix = 'eqdkp2_';

//create the new database connection
$link = mysql_connect($DBhost, $DBuser, $DBpass);
$result = mysql_query("SELECT item_name, item_buyer FROM ".$DBName.".".$eqdkp_prefix."items order by item_date desc limit $limit") or die(mysql_error());

echo '<table>';
while ($row = mysql_fetch_array($result)) {

$last_mc_loot = $row['item_name'];
$buyer = $row['item_buyer'];
$myhtml = "<tr><td>[itemico]".$last_mc_loot."[/itemico]</td><td>[item]".$last_mc_loot."[/item]<br/>Looted  by ".$buyer."</td></tr>";
echo itemstats_parse($myhtml);
}
echo '</table>';
mysql_close($link);


Hakker

Finally got it working anyone know how to get the borders around the links gone? I think it's in the TP WoW Risen theme but dunno what part of the css.

Ferocity

Doesnt seem to work if eqdkp is in a seperate table from SMF as it seems to pull data as the SMF user acct.

laric

Quote from: Ferocity on December 06, 2007, 10:23:29 PM
Doesnt seem to work if eqdkp is in a seperate table from SMF as it seems to pull data as the SMF user acct.

If you use the one I have posted a few posts up it will work properly with a different database. Heck it even works with a different database server.

Cal

Okay, I'm kind of at a loss.  I am using the block snippet from the message immediately above, I have edited my Sources/TPortal.php file with the code for the TPparseWoWItems function, and I still can't make the Itemstats display.  It's pulling correctly from the EQDKP database, it's just only printing [item]Wildfury Greatstaff[/item] instead of the link and hover tooltip.

The code I am using is exactly as the most recent above.  I know I must be missing something really simple, I just don't know what it is.

laric

I think you are missing
echo itemstats_parse($myhtml);

Cal

Quote from: laric on January 02, 2008, 03:49:08 PM
I think you are missing
echo itemstats_parse($myhtml);

Unfortunately no, I checked that.  Here is my block, with identifying information removed:

include_once("/home/xxx/html/Sources/itemstats/smf_itemstats.php");

// db config

$linkmoreloot = '';
$DBhost = 'localhost';
$DBuser = 'xxx';
$DBpass = 'xxx';
$DBName = 'xxx';
$limit = 10;
$eqdkp_prefix = 'eqdkp_';

//create the new database connection
$link = mysql_connect($DBhost, $DBuser, $DBpass);
$result = mysql_query("SELECT item_name, item_buyer FROM ".$DBName.".".$eqdkp_prefix."items order by item_date desc limit $limit") or die(mysql_error());

echo '<table>';
while ($row = mysql_fetch_array($result)) {

$last_mc_loot = $row['item_name'];
$buyer = $row['item_buyer'];
$myhtml = "<tr><td style=\"font-size:10px\">[item]".$last_mc_loot."[/item]<br/>Looted  by ".$buyer."</td></tr>";
echo itemstats_parse($myhtml);
}
echo '</table>';


And I modified my Sources/TPortal.php using the instructions found here.

Thanks for your help!

laric

Quote from: Cal on January 02, 2008, 10:50:15 PM
include_once("/home/xxx/html/Sources/itemstats/smf_itemstats.php");


I had a problem with this line at one time and thus got the problem. try changing it to require_once to see if it gets loaded.

Cal

Neither require_once nor include_once give me any change.  Just to test, I switched it to require(), and as expected it returned a cannot redeclare error, so it *is* being included in the page.

Itemstats is working correctly on forum posts and in standard HTML articles, just not in the block.

laric

Quote from: Cal on January 02, 2008, 10:50:15 PM
And I modified my Sources/TPortal.php using the instructions found here.

It might because I have not done that part.
I am actually not using that version of itemstats. I am using the one with wowhead from the eqdkp forum.

This website is proudly hosted on Crocweb Cloud Website Hosting.