The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
See this script: http://www.vbhackers.com/testportal.php
Why is the variable $vbulletin->sitenews['newstitle'] not showing the correct information? |
|
#2
|
|||
|
|||
|
Code:
// table prefix fix
$PortalNews = $vbulletin->db->query_first("
SELECT " . TABLE_PREFIX . "thread.*, post.pagetext AS pagetext
FROM " . TABLE_PREFIX . "thread
LEFT JOIN " . TABLE_PREFIX . "post AS post
ON(post.postid = " . TABLE_PREFIX . "thread.firstpostid)
WHERE forumid = 2
ORDER BY dateline DESC
");
// or however you want to do it
Code:
// make an array
if (is_array($vbulletin->sitenews))
{
echo " Yes, an array. ";
}
else
{
echo " No, not array. ";
}
$vbulletin->sitenews = unserialize($vbulletin->sitenews);
echo $vbulletin->sitenews['newstitle'];
// check out $unserialize and function register in class core
|
|
#3
|
|||
|
|||
|
Worked perfect. Thanks man. Quick question for you though.
PHP Code:
PHP Code:
|
|
#4
|
|||
|
|||
|
It has no purpose other than to echo the issue.
|
|
#5
|
|||
|
|||
|
One last question for you Calorie. How do you greab the info from datastore when the info is an array() with 8 array()'s within that array(). If that made sense to you.
Stupid merge crap... EDITED POST. This seemed to work for me PHP Code:
|
|
#6
|
|||
|
|||
|
PHP Code:
PHP Code:
PHP Code:
|
|
#7
|
|||
|
|||
|
Liked your way better.
Thanks to you I now completely understand vBulletins datastore system.
|
|
#8
|
|||
|
|||
|
Thanks, your way threw an 'invalid argument supplied for foreach' error.
![]() BTW, you don't need ksort because you're ordering by dateline in the query, dumping into $ary[], and un/serialize will keep the order. You could dump into $ary[$threadid] and then ksort to order by the thread ID, but then there'd be no point to order by in the query. |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|