Quote:
Originally Posted by krike
just thought I would share with the people who are looking for help.
my vB version is 3.8.1
I needed to query a table I created myself to display all the tutorials of that specific user.
here is the code I used and it works like a charm
Code:
function prepare_output($id = '', $options = array())
{
$sql = mysql_query("SELECT * FROM tutorials WHERE approved = 1 AND user_id=".$this->profile->userinfo[userid]."");
$test = "<ul>";
while($result = mysql_fetch_array($sql))
{
$test .= "<li> <img src='http://cmstutorials.org/".$result['tutorial_thumb']."' width='50' height='50' alt='' />
<a href='http://cmstutorials.org/tutorial/".$result['tutorial_id']."' target='_blank'>".$result['title']."</a></li>
";
}
$test .= "</ul>";
$this->block_data['mymodification'] = $test;
}
--------------- Added [DATE]1252407273[/DATE] at [TIME]1252407273[/TIME] ---------------
how do you call a specific tab with a url?
http://cmstutorials.org/forums/member.php?u=1#tabname ????
--------------- Added [DATE]1252407322[/DATE] at [TIME]1252407322[/TIME] ---------------
ok I found it http://cmstutorials.org/forums/membe...1&tab=favorite
|
Is tutorial_thumb a column in one of you sql tables? I'm trying to do something similar but it's really kicking my butt.
I have a form users submit their resume's on. It saves it to the database in the table
formresults. The information I want to display on the profile is located in a column labeled
output in the formresults table.
Below is the code I'm using in the member_build_blocks_start hook location.
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 output FROM " . TABLE_PREFIX . "formresults WHERE userid = '.$this->profile->userinfo[userid].' AND title = 'Resume' ");
$test = "<div>";
while($result = mysql_fetch_array($sql))
{
$test .= "'.$result['output'].'"
";
}
$test .= "</div>";
$this->block_data['resume'] = $test;
}
}
I think the code in bolded red is the part I'm getting lost on?
I get this error when displaying the memberinfo profile page.
Quote:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/righscom/public_html/addons/projectfanboy/vb/member.php(463) : eval()'d code on line 249
|