• Support will be limited until May 8th, as I will be out of the office travelling. Thank you for your patience and understanding.
Status
Not open for further replies.

Mick

Customer
Hi again :),

I am integrating itraders into this modification and just wondered if someone could help me with a small plugin

Have a look how far I have got so far:

For Sale. RGH Halo4 Slim

You can see the classifieds feedback just above the attachments :)

This is only visible in the classifieds forums of course :)

However,

I am looking to add a plugin for the showthreads page to be able to get the percentage score as you can see it just shows a percentage.


Here is my thinking
Code:
$tradepcnt = $vbulletin->db->query_first_slave("
		SELECT itrader_pcnt
		FROM " . TABLE_PREFIX . "itrader
		WHERE $thread['userid'] = " . $userinfo['userid'] . "
	");

vB_Template::preRegister('showthread',array('tradepcnt' => $tradepcnt));

Would that work, and what would be the implications of such a query?

Regards
Mick
 
If you add that query to showthread_query (and not postbit_display_complete or some other looped plugin) there should be zero implications beyond the 0.0001 seconds it takes to execute that query ;P

That being said, the query seems to be invalid. My guess is, you meant to do something like
Code:
WHERE userid = " . $thread['userid'] . "
instead?
 
Yes I actually wrote that while looking at the code in notetab. and on here.

Going to test it now...

Thank you... was a little worried about it being in a loop but your plugin hook suggestion sounds great :)

Regards
Mick
 
Tried both

$thread['userid']
and
$threadinfo['userid']

Trying to pull the first posters userid

Regards
Mick
 
$threadinfo[userid]

this did work I was pulling the data from the wrong table.. should of been the user table...

I am going to wrap the code around a

if forumid = classifieds forums array aswell so its not called unless its in them forums, is that sensible ?

Regards
Mick
 
I'm not sure I understand your question, but you can ensure the code doesn't run in any forums other than the ones you want by doing
PHP:
if (in_array($threadinfo['forumid'], array(x, y, z, a, b, c)))
{
// Code goes here
}
 
Yeah that is perfect, I was just wondering if that would be better than an SQL call for every showthread call page load?

Also the

$threadinfo['userid']

Breaks the SQL?

Do you have any idea which variable is used to store the USERID in showthread... I have looked in showthread.php and found

$threadinfo['postuserid']

But that is not displaying anything ?

Regards
Mick
 
Sorry about the amount of posts.

I have this working fully now :)

$threadinfo['postuserid'] is correct :)

For Sale. RGH Halo4 Slim

As you can see it also pulls the percentage from the database.

Thanks so much Fillip H. not sure I would of gotten there without you!

Mick
 
Status
Not open for further replies.

Legacy DragonByte vBForms

vBulletin 3.8.x vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
385
Customer rating
0.00 star(s) 0 ratings
Back
Top