The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I'm currently modifying a piece of code, but I can't get it to work within vbulletin, it keeps giving me the wrong results.
What the code below is basically doing is getting a list of quests from the database, and putting them into templates and then displaying the results in a table, that part works great, but the part that isn't is the Percentage of what is complete. For each row that it builds it should be checking another database table, adding up how many rows there are for each q_id and from working out how many of those rows are marked as complete it will make a percentage which is then passed into my template. However it doesn't process the highlighted part in the code below and gives me a value of zero for both of the variables, If i take out the IF statements it will give me results for everything (which is bad), so I know it's the conditions that are wrong...but why? Any help is appreciated. PHP Code:
|
#2
|
|||
|
|||
![]() PHP Code:
|
#3
|
|||
|
|||
![]() Quote:
I'm not quite sure of the formatting on searching through results stored in an array, but i think the code above is basically checking [row number] and [q_stepdesc] on each row to see if that record has text in it, if so it will run the code that follows...which it isn't..... |
#4
|
|||
|
|||
![]()
You will need to place the following inside a loop (a while loop for example):
PHP Code:
|
#5
|
|||
|
|||
![]()
i just tried putting it into a loop but with the same results, but from what i can see...is it needed as the previous query is looping and doesn't that one store the complete list in an array? which I am then searching through.
thanks for any advice given |
#6
|
|||
|
|||
![]() PHP Code:
![]() |
#7
|
|||
|
|||
![]() Quote:
Thanks, I'll be comparing the code now to see where I went wrong. ![]() ![]() ![]() I've been trying to put all the code above into a function call so that I can set different searches but use the same templates etc but have run into one small problem (again) The code originally ran and put the results into a table built up from the templates and displayed the code with the style from my site and stored it in $questlist which I displayed in my main template. Worked great. but now that I have put the code into function fetch_mainquestlist() which returns the results in $questlist it doesn't have any of the formatting from my vbulletin style, it's just a flat table with no style to it... I believe it is the quest_header template which calls in things like: cellpadding="$stylevar[cellpadding]" so why doesn't my function include these yet the rest of the page does? do i have to do something to return $questlist; at the end of my function, or something to the statement in my code that calls it: $questlist = fetch_questlist(); any help is really appreciated. (i'm pretty new to this as you've probably guessed) |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|