The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I am trying to get a list of polls that are active, and all I am getting returnes is the word "Array". I looked and can't figure out what is wrong. Can someone help, please?
$pollist = $DB_site->query("SELECT thread.threadid AS thread_id, thread.title AS thread_title, thread.pollid AS thread_pollid, poll.pollid AS poll_pollid, poll.active AS poll_active, poll.dateline AS poll_dateline, poll.public AS poll_public, user.userid, user.username FROM ".TABLE_PREFIX."thread AS thread, ".TABLE_PREFIX."poll AS poll, ".TABLE_PREFIX."user AS user LEFT JOIN " . TABLE_PREFIX . "deletionlog AS dlog_t ON (dlog_t.primaryid = thread.threadid AND dlog_t.type = 'thread') LEFT JOIN " . TABLE_PREFIX . "deletionlog AS dlog_p ON (dlog_p.primaryid = poll.pollid AND dlog_p.type = 'poll') WHERE thread.pollid = poll.pollid AND poll.active = 1 AND dlog_t.primaryid IS NULL AND dlog_p.primaryid IS NULL ORDER BY poll.dateline DESC LIMIT 10"); while($pollist = $DB_site->fetch_array($pollist)) { eval('$activepolls[\'pollist\'] .= "' . fetch_template('pollist') . '";'); } unset($pollist); $DB_site->free_result($pollist); |
#2
|
||||
|
||||
![]()
This would be a fairly big and bogged down query, why not just use RSS feeds or xml or js?
|
#3
|
|||
|
|||
![]()
and how would I do that? either one of them?
|
#4
|
|||
|
|||
![]()
Try this
PHP Code:
Hope that helps. |
#5
|
|||
|
|||
![]()
Hi, thank you for your post. The template displays everything but the data itself.
|
#6
|
|||
|
|||
![]()
Well in your orignal post you have eval('$activepolls[\'pollist\'] I don't belive the \ will work, but i could be wrong.
and you have while($pollist = $DB_site->fetch_array($pollist)) so you saying while calling the database query array the query again. you have $pollist as your db call and as you fetch_array. |
#7
|
|||
|
|||
![]()
I just copied and pasted yours, changing only the template values to match yours.
|
#8
|
|||
|
|||
![]()
I got it.It works when I put pollist instead of showpollist. Thanks
while($pollist = $DB_site->fetch_array($pollist)) { eval('$activepolls = "' . fetch_template('pollist') . '";'); } |
#9
|
|||
|
|||
![]()
That what i tried telling you. Glad its working
![]() Quote:
![]() |
#10
|
|||
|
|||
![]() Quote:
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|