The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I have a forum (ID 26 for explaining purposes), and I have already installed a blank extra tab in everyone's profile. What I would like to do is have the latest thread the user has posted in forumid26 to appear in that tab. (JUST the body content). How would I set up the variables for this?
|
|
#2
|
||||
|
||||
|
Query for it.... something like (you'll have to play with it):
PHP Code:
|
|
#3
|
|||
|
|||
|
I used that, and it gives me the following error:
Code:
Parse error: syntax error, unexpected T_STRING in D:\Inetpub\virtual\xmf53y55qg\WWWROOT\forum\member.php(462) : eval()'d code on line 31 Code:
$blocklist = array_merge($blocklist, array(
'mymodification' => array(
'class' => 'MyModification',
'title' => 'Portfolio',
'hook_location' => 'profile_left_last'
)
));
class vB_ProfileBlock_MyModification extends vB_ProfileBlock
{
var $template_name = 'memberinfo_block_mymodification';
function confirm_empty_wrap()
{
return false;
}
function confirm_display()
{
return ($this->block_data['mymodification'] != '');
}
function prepare_output($id = '', $options = array())
{
$this->block_data['mymodification'] = '$myid=$this->profile->userinfo['userid'];
$getthreads = $vbulletin->db->query_first("
SELECT thread.threadid,thread.title,thread.dateline,thread.forumid,thread.firstpostid, post.pagetext
FROM " . TABLE_PREFIX ."thread
LEFT JOIN " . TABLE_PREFIX ."post ON (post.postid=thread.firstpostid)
WHERE postuserid = '$myid' AND forumid=26 AND sticky=0
ORDER BY thread.dateline DESC
LIMIT 1
");';
}
}
|
|
#4
|
||||
|
||||
|
Um... no. You need to do the query and all before you ever try to put anything into $this->block_data. You need to grab the info and get the variables defined before you ever try to spit it out as data (which is what $this->block_data is). Put it in the function, but before the block_data gets spit out. You are going to have to write the block_data stuff all yourself. I'm just giving you the query to get the information you need.
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|