View Full Version : Using Array in Template Problem
BamaStangGuy
19 Oct 2007, 08:12
I am trying to get this to work right.
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Using showthread_start query
If I use a print_r on $lyrics it spits out the array at the top of the page. So I know the query works.
print_r($lyrics['title']); spits out the correct title to.
What isn't working is when I use the variable in the template. It just shows up blank where the variable output is suppose to be.
Any idea why?
Danny.VBT
19 Oct 2007, 09:26
What template are you using it in? And you should have to query the thread table, as this is already done and the info is put in $thread array.
BamaStangGuy
19 Oct 2007, 10:47
postbit
I'm not sure how I would compare the post title of one forum with the post title of another one to make sure they are the same based on the thread you are in without a query. It very well could be possible but I have no idea how.
--------------- Added 1192824968 at 1192824968 ---------------
Anyone else have any idea? Like I said, the query works fine and the variable has the array in it but it won't work when used in a template :(
BamaStangGuy
21 Oct 2007, 09:11
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
I am guessing the variable scope is preventing me from using $lyrics within the postbit template? I have tried adding global $lyrics; to the above plugin and add it as a seperate plugin in global start but it still won't work.
I've tried $GLOBALS[lyrics] in the template but no luck either.
What am I missing here? All I want to do is use $lyrics within postbit
Danny.VBT
21 Oct 2007, 09:31
I am not really sure what you are doing. The thread you are pulling is different then the one you that the post belongs too? It seems you like you have some issues with database normalization, if that is the case.
I am just trying to get this efficient as possible for you.
SirAdrian
21 Oct 2007, 09:55
Add a plugin to postbit_display_complete
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
The postbit template is not evaluated in global scope.
BamaStangGuy
21 Oct 2007, 19:15
I am not really sure what you are doing. The thread you are pulling is different then the one you that the post belongs too? It seems you like you have some issues with database normalization, if that is the case.
I am just trying to get this efficient as possible for you.
http://www.exposethemusic.com/forums/t648/
http://www.exposethemusic.com/forums/t644/
Those two threads are the same. What I am trying to do is if you are in f32 I am taking the thread title of the thread you are in and searching f34 to see if the exact same thread exists. If it does then I want to link to that thread.
Add a plugin to postbit_display_complete
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
The postbit template is not evaluated in global scope.
Giving this a shot
Thanks this worked :)
vBulletin® v3.6.12, Copyright ©2000-2009, Jelsoft Enterprises Ltd.