Quote:
Originally Posted by dartho
shouldn;'t it just be :
PHP Code:
$test .= $result['output'];
|
Thank you, that got rid of the annoying error. I really could've sworn I had tried that before but apparently not.
The Resume tab shows up now, unfortunately there is still no data in it. Could it be the type of data that's in there (a mixture of html and php variables) causing it to not show up?
--------------- Added [DATE]1262744048[/DATE] at [TIME]1262744048[/TIME] ---------------
Hmmm... I guess not. I changed the data in there to be just the string "This is only a test" and still nothing shows up.
--------------- Added [DATE]1262744441[/DATE] at [TIME]1262744441[/TIME] ---------------
HOLY CRAP! I'm almost there! I've been working on this for like a week and I was almost ready to give up but now I'm
ALMOST THERE!
The problem was the SQL query was returning no results because apparently this line of code doesn't work the way I thought it did.
PHP Code:
.$this->profile->userinfo[userid].
I changed that to my userid and it worked! Now I just need to figure out the right way to call for the user profile id!

Thanks everyone!
--------------- Added [DATE]1262745188[/DATE] at [TIME]1262745188[/TIME] ---------------
Quote:
Originally Posted by Warlord
HOLY CRAP! I'm almost there! I've been working on this for like a week and I was almost ready to give up but now I'm ALMOST THERE!
The problem was the SQL query was returning no results because apparently this line of code doesn't work the way I thought it did.
PHP Code:
.$this->profile->userinfo[userid].
I changed that to my userid and it worked! Now I just need to figure out the right way to call for the user profile id!  Thanks everyone!
|
Okay, apparently it
does work the way I thought it did, I just had removed the extra " because I thought it was wrong. I still don't quite understand why it should be there but it seems to work now! Woohoo!


For anyone who's interested in what the code looked like that finally ended up working, here it is.
PHP Code:
$blocklist = array_merge($blocklist, array(
'resume' => array(
'class' => 'Resume',
'title' => 'Resume',
'hook_location' => 'profile_left_last'
)
));
class vB_ProfileBlock_resume extends vB_ProfileBlock
{
var $template_name = 'memberinfo_block_resume';
function confirm_empty_wrap()
{
return false;
}
function confirm_display()
{
return ($this->block_data['resume'] != '');
}
function prepare_output($id = '', $options = array())
{
global $db;
$sql= $db->query_read("SELECT * FROM " . TABLE_PREFIX . "formresults WHERE title = 'Resume' AND userid=".$this->profile->userinfo[userid]."");
$test = "<div>";
while($result = mysql_fetch_array($sql))
{
$test .= $result['output'];
}
$test .= "</div>";
$this->block_data['resume'] = $test;
}
}