![]() |
Why won't this plugin work?
This is me attempting to convert a "thread of the day" hack from 3.8.
I've read the article on variable registeringand have converted quite a few hacks, so I've *sort* of got my head round that. However, the below (at search_start) simply doesn't work. the contents of the template are output fine, but the variable $devebd['whatever'] does not output at all. I think I have done the registration of the variable right, because if I add this line to the plugin: Code:
$devebd['test'] = ""Something"; So, I think there is something wrong with how that query is being handled. I know it's being executed, because if I add a rogue character to any of the table names it throws a database error at me. Yet, the query is identical to how it was in vB3 and it worked. Any suggestions on what's wrong? Here is the plug in: Code:
$exforums1 = $vbulletin->options['btwexfor']; |
I don't know much about vB4 and I usually stay in the vB3 section, but: I think the stuff at the bottom needs to be inside the while loop. I think the reason you never see anything in $devebd is because it's undefined when the loop finally exits.
|
Quote:
|
I see...yeah, that does sound like maybe the query isn't returning anything. Do you have a way to execute SQL? I would probably try that query myself and see what happens.
|
Quote:
|
Given that it has "LIMIT 1" in the query, I think I would have used query_first instead like
Code:
$devebd = $db->query_first(" and then I think the rest would just be Code:
$devebd['trimmed'] = fetch_trimmed_title($devebd['fth'], 43); Anyway, I guess it's been kind of slow during the holidays, but there's got to be someone around who knows vB4. |
Thanks that does seem to be the issue...there is no "while" clause required as there's only 1 in the query.
Odd that should be the case seeing as it wasn't like that in vb3 and, to my knowledge, the database structures involved are identical. Oh well...the joys of coding. :) Especially for vB4 which appears to write its own rules as it goes along. |
All times are GMT. The time now is 10:26 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|