View Full Version : Simple Conditionals Question
I have created a Multiple-Selection Menu with the options set as "Right" and "Left". Right is the default value.
I want to be able to display "this code" if they choose "Right" as their option or "this code" if they choose "left".
The field in question is "field14".
What conditional statement would I use in a template to have the code displayed per the selection chosen?
Thanks.
peterska2
05-20-2006, 12:46 PM
<if condition="$post[field14]=='1'">Stuff for first check box goes here<else />stuff for first checkbox unchecked goes here</if>
<if condition="$post[field14]=='2'">staff for second check box goes here<else />stuff for second checkbox unchecked goes here</if>
peterska2
05-20-2006, 01:10 PM
No prob Rich. Happy to help as always. :)
I am not sure what I am doing wrong, but the conditions aren't working properly. (Notice I said what I am doing wrong. lol)
I am trying to allow my users the ability to choose between a left or right column in their journals using Andreas' modification.
I know I need to edit the journal_journalpage template.
This is what the template consists of after I have added both layouts that need to be controlled via the conditionals.
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle] - Reptile Blogs - <if condition="$journalinfo[journalname]">$journalinfo[journalname]<else /><phrase 1="$journalinfo[journalist]">$vbphrase[xs_journal]</phrase></if></title>
</head>
<body>
$header
$navbar
<!-- Start Locked Status -->
<if condition="$journalinfo[status]==1">
<table bgcolor="#FFFFFF" width="100%" border="1">
<tr>
<td align="center"><font color="#FF0000" size="4"><b>$vbphrase[this_journal_is_locked]</b></font></td>
</tr>
</table>
</if>
<!-- End Locked Status -->
<table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2">
<!-- Start Blog Information Table -->
<table class="tborder" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0" align="center" width="100%" style="border-bottom-width:0px">
<tr>
<td class="tcat" align="$stylevar[left]" width="100%">$vbphrase[journal_information]</td>
<td id="journalopt" class="vbmenu_control"><a href="#journalopt">$vbphrase[journal_tools]</a> <script type="text/javascript"> vbmenu_register("journalopt"); </script></td>
<td id="journalsearch" class="vbmenu_control"><a href="#journalsearch">$vbphrase[search_this_journal]</a> <script type="text/javascript"> vbmenu_register("journalsearch"); </script></td>
<if condition="$can[rate]"><td id="journalrate" class="vbmenu_control"><a href="#journalrate"><if condition="$journalrating==0">$vbphrase[rate_journal]<else />$vbphrase[rating]: <img src="$stylevar[imgdir_rating]/rating_$journalrating.gif" border="0" /></if></a> <script type="text/javascript"> vbmenu_register("journalrate"); </script></td></if>
</tr>
</table>
<table class="tborder" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0" align="center" width="100%">
<tr>
<td class="alt2" nowrap="nowrap" align="top">
<if condition="!empty($avatarurl)">
<a href="member.php?u=$journalinfo[journalist_id]"><img src="$avatarurl" border="0" alt="<phrase 1="$journalinfo[journalist]">$vbphrase[xs_avatar]</phrase>" /></a>
<else />
<div class="smallfont">$vbphrase[no_avatar_specified]</div>
</if>
</td>
<td class="alt1" nowrap="nowrap" width="100%">
<table width="100%">
<tr>
<td width="50%">
<div class="smallfont">
<b>Blogger</b>: <a href="member.php?userid=$journalinfo[journalist_id]">$journalinfo[journalist]</a>
</div>
</td>
<td width="50%">
<div class="smallfont">
<b>$vbphrase[status]</b>: <if condition="$journalinfo[private]=='1'"><b><font color="red">$vbphrase[private]</font></b><else /><b><font color="green">$vbphrase[public]</font></b></if>
</div>
</td>
</tr>
<tr>
<td>
<div class="smallfont">
<b>$vbphrase[entries]</b>: $journalinfo[entrycount] ($vbphrase[private]: $private[count])
</div>
</td>
<td>
<div class="smallfont">
<b>$vbphrase[comments]</b>: $journalinfo[commentcount]
</div>
</td>
</tr>
<tr>
<td>
<div class="smallfont">
<b>$vbphrase[start_date]</b>: $journal[startdate]
</div>
</td>
<td>
<div class="smallfont">
<b>$vbphrase[last_update]</b>: <if condition="$journalinfo[entrycount]==0">$journal[startdate]<else />$journalinfo[lastupdated]</if>
</div>
</td>
</tr>
<tr>
<td>
<div class="smallfont">
<b>Views</b>: $journalinfo[journalviews]
</div>
</td>
<td>
<div class="smallfont">
<if condition="$bbuserinfo[usergroupid]=='6'"><b>$vbphrase[start_ip]</b>: $journalinfo[ipaddress]<else /> </if>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="smallfont">
<if condition="$journalinfo[journaldesc]"><b>$vbphrase[description]</b>: $journalinfo[journaldesc]</if>
</div>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<!-- End Blog Information Table -->
<br />
<!-- Start Left Column Blog Table -->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="25%" align="center" valign="top">Left Column</td>
<td width="75%" align="center">
<table width="100%" border="0" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
<tr valign="bottom">
<td align="left" style="padding-bottom:3px;">
<if condition="$bbuserinfo[userid]==$journalinfo[journalist_id] AND $journalinfo[status]!=1"><form method="post" action="blogs.php?do=addentry&j=$j">
<a href="blogs.php?$session[sessionurl]do=addentry&j=$j"><img border="0" src="$stylevar[imgdir_button]/newentry.gif" width="100" height="26" alt="$vbphrase[new_entry]" /></a>
</if>
</td>
<td align="right" style="padding-bottom:3px;">
$pgnav
</td>
</tr>
<tr>
<td colspan="2" align="center">
$entrybits
</td>
</tr>
<tr valign="top">
<td align="left" style="padding-top:3px;">
<if condition="$bbuserinfo[userid]==$journalinfo[journalist_id] AND $journalinfo[status]!=1"><form method="post" action="blogs.php?do=addentry&j=$j">
<a href="blogs.php?$session[sessionurl]do=addentry&j=$j"><img border="0" src="$stylevar[imgdir_button]/newentry.gif" width="100" height="26" alt="$vbphrase[new_entry]" /></a>
</if>
</td>
<td align="right" style="padding-top:3px;">
$pgnav
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- End Left Column Blog Table -->
<!-- Start Right Column Blog Table -->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="75%" align="center" valign="top">
<table width="100%" border="0" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
<tr valign="bottom">
<td align="left" style="padding-bottom:3px;">
<if condition="$bbuserinfo[userid]==$journalinfo[journalist_id] AND $journalinfo[status]!=1"><form method="post" action="blogs.php?do=addentry&j=$j">
<a href="blogs.php?$session[sessionurl]do=addentry&j=$j"><img border="0" src="$stylevar[imgdir_button]/newentry.gif" width="100" height="26" alt="$vbphrase[new_entry]" /></a>
</if>
</td>
<td align="right" style="padding-bottom:3px;">
$pgnav
</td>
</tr>
<tr>
<td colspan="2" align="center">
$entrybits
</td>
</tr>
<tr valign="top">
<td align="left" style="padding-top:3px;">
<if condition="$bbuserinfo[userid]==$journalinfo[journalist_id] AND $journalinfo[status]!=1"><form method="post" action="blogs.php?do=addentry&j=$j">
<a href="blogs.php?$session[sessionurl]do=addentry&j=$j"><img border="0" src="$stylevar[imgdir_button]/newentry.gif" width="100" height="26" alt="$vbphrase[new_entry]" /></a>
</if>
</td>
<td align="right" style="padding-top:3px;">
$pgnav
</td>
</tr>
</table>
</td>
<td width="25%" align="center" valign="top">Right Column</td>
</tr>
</table>
<!-- End Right Column Blog Table -->
<br /><br />
<div class="vbmenu_popup" id="journalopt_menu" style="display:none">
<table cellpadding="4" cellspacing="0" border="0"
style="border-collapse: collapse" bordercolor="#111111">
<if condition="$canview[comments]">
<tr>
<td class="thead">$vbphrase[journal_tools]</td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=showcomments&j=$j">$vbphrase[view_comments]</a></td>
</tr>
</if>
<tr>
<td class="thead">$vbphrase[download]</td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=downloadjournal&j=$j&type=txt">$vbphrase[txt_format]</a></td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=downloadjournal&j=$j&type=xml">$vbphrase[xml_format]</a></td>
</tr>
<if condition="$bbuserinfo[usergroupid]==6">
<tr>
<td class="thead">$vbphrase[admin_tools]</td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=lockjournal&j=$j"><if condition="$journalinfo[status]==1">$vbphrase[unlock_journal]<else />$vbphrase[lock_journal]</if></a></td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=editjournal&j=$j">$vbphrase[edit_journal_settings]</a></td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=delete&j=$j&t=j">$vbphrase[delete_journal]</a></td>
</tr>
</if>
<if condition="$bbuserinfo[userid]==$journalinfo[journalist_id] AND $journalinfo[status]!=1">
<tr>
<td class="thead">$vbphrase[journalist_options]</td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=addentry&j=$j">$vbphrase[new_entry]</a></td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=editjournal&j=$j">$vbphrase[edit_journal_settings]</a></td>
</tr>
<if condition="$candeleteown[journal]">
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=delete&j=$j&t=j">$vbphrase[delete_journal]</a></td>
</tr>
</if>
</if>
</table>
</div>
<div class="vbmenu_popup" id="journalsearch_menu" style="display:none">
<form action="blogs.php" method="get">
<input type="hidden" name="do" value="searchresults" />
<input type="hidden" name="st" value="6" />
<input type="hidden" name="j" value="$j" />
<table cellpadding="4" cellspacing="1" border="0">
<tr><td class="thead">$vbphrase[search_this_journal]</td></tr>
<tr><td class="vbmenu_option" title="nohilite"><input type="text" name="sk" value="" size="20" maxlength="50" /> <input type="submit" value="Go" class="button" /></td></tr>
<tr><td class="vbmenu_option"><a href="blogs.php?do=search" title="$vbphrase[advanced_journal_search]">$vbphrase[advanced_search]</a></td></tr>
</table>
</form>
</div>
<div class="vbmenu_popup" id="journalrate_menu" style="display:none">
<if condition="$show[voteform]">
<form action="blogs.php?do=ratejournal" method="post">
</if>
<table cellpadding="4" cellspacing="1" border="0">
<if condition="$show[voteform]">
<tr>
<td class="thead">$vbphrase[rate_this_journal]</td>
</tr>
<tr>
<td class="vbmenu_option" title="nohilite">
<div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_5.gif" alt="$vbphrase[excellent]" /><label for="vote5"><input type="radio" name="rating" value="5" />$vbphrase[excellent]</label></div>
<div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_4.gif" alt="$vbphrase[good]" /><label for="vote4"><input type="radio" name="rating" value="4" />$vbphrase[good]</label></div>
<div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_3.gif" alt="$vbphrase[average]" /><label for="vote3"><input type="radio" name="rating" value="3" />$vbphrase[average]</label></div>
<div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_2.gif" alt="$vbphrase[bad]" /><label for="vote2"><input type="radio" name="rating" value="2" />$vbphrase[bad]</label></div>
<div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_1.gif" alt="$vbphrase[terrible]" /><label for="vote1"><input type="radio" name="rating" value="1" />$vbphrase[terrible]</label></div>
</td>
</tr>
<tr>
<td class="vbmenu_option" title="nohilite" align="center">
<input type="hidden" name="j" value="$j" />
<input type="submit" class="button" value="$vbphrase[vote_now]" />
</td>
</tr>
<else />
<tr>
<td class="alt1" nowrap="nowrap"><div class="smallfont">$vbphrase[already_rated]</div></td>
</tr>
</if>
</table>
<if condition="$show[voteform]">
</form>
</if>
</div>
<!-- / NAVBAR POPUP MENUS -->
$footer
</body>
I have tried all sorts of different variations of the conditionals displayed, but I can get it to detect which option I have chosen. Someone with more knowledge may be better inclined as to show me what I am doing wrong.
(I have commented both layouts within the code.)
peterska2
05-20-2006, 07:56 PM
ok, use this as your journal_journalpage template
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle] - Reptile Blogs - <if condition="$journalinfo[journalname]">$journalinfo[journalname]<else /><phrase 1="$journalinfo[journalist]">$vbphrase[xs_journal]</phrase></if></title>
</head>
<body>
$header
$navbar
<!-- Start Locked Status -->
<if condition="$journalinfo[status]==1">
<table bgcolor="#FFFFFF" width="100%" border="1">
<tr>
<td align="center"><font color="#FF0000" size="4"><b>$vbphrase[this_journal_is_locked]</b></font></td>
</tr>
</table>
</if>
<!-- End Locked Status -->
<table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2">
<!-- Start Blog Information Table -->
<table class="tborder" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0" align="center" width="100%" style="border-bottom-width:0px">
<tr>
<td class="tcat" align="$stylevar[left]" width="100%">$vbphrase[journal_information]</td>
<td id="journalopt" class="vbmenu_control"><a href="#journalopt">$vbphrase[journal_tools]</a> <script type="text/javascript"> vbmenu_register("journalopt"); </script></td>
<td id="journalsearch" class="vbmenu_control"><a href="#journalsearch">$vbphrase[search_this_journal]</a> <script type="text/javascript"> vbmenu_register("journalsearch"); </script></td>
<if condition="$can[rate]"><td id="journalrate" class="vbmenu_control"><a href="#journalrate"><if condition="$journalrating==0">$vbphrase[rate_journal]<else />$vbphrase[rating]: <img src="$stylevar[imgdir_rating]/rating_$journalrating.gif" border="0" /></if></a> <script type="text/javascript"> vbmenu_register("journalrate"); </script></td></if>
</tr>
</table>
<table class="tborder" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0" align="center" width="100%">
<tr>
<td class="alt2" nowrap="nowrap" align="top">
<if condition="!empty($avatarurl)">
<a href="member.php?u=$journalinfo[journalist_id]"><img src="$avatarurl" border="0" alt="<phrase 1="$journalinfo[journalist]">$vbphrase[xs_avatar]</phrase>" /></a>
<else />
<div class="smallfont">$vbphrase[no_avatar_specified]</div>
</if>
</td>
<td class="alt1" nowrap="nowrap" width="100%">
<table width="100%">
<tr>
<td width="50%">
<div class="smallfont">
<b>Blogger</b>: <a href="member.php?userid=$journalinfo[journalist_id]">$journalinfo[journalist]</a>
</div>
</td>
<td width="50%">
<div class="smallfont">
<b>$vbphrase[status]</b>: <if condition="$journalinfo[private]=='1'"><b><font color="red">$vbphrase[private]</font></b><else /><b><font color="green">$vbphrase[public]</font></b></if>
</div>
</td>
</tr>
<tr>
<td>
<div class="smallfont">
<b>$vbphrase[entries]</b>: $journalinfo[entrycount] ($vbphrase[private]: $private[count])
</div>
</td>
<td>
<div class="smallfont">
<b>$vbphrase[comments]</b>: $journalinfo[commentcount]
</div>
</td>
</tr>
<tr>
<td>
<div class="smallfont">
<b>$vbphrase[start_date]</b>: $journal[startdate]
</div>
</td>
<td>
<div class="smallfont">
<b>$vbphrase[last_update]</b>: <if condition="$journalinfo[entrycount]==0">$journal[startdate]<else />$journalinfo[lastupdated]</if>
</div>
</td>
</tr>
<tr>
<td>
<div class="smallfont">
<b>Views</b>: $journalinfo[journalviews]
</div>
</td>
<td>
<div class="smallfont">
<if condition="$bbuserinfo[usergroupid]=='6'"><b>$vbphrase[start_ip]</b>: $journalinfo[ipaddress]<else /> </if>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="smallfont">
<if condition="$journalinfo[journaldesc]"><b>$vbphrase[description]</b>: $journalinfo[journaldesc]</if>
</div>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<!-- End Blog Information Table -->
<br />
<!-- Start Columns Table -->
<table border="0" width="100%" align="center">
<tr>
<!-- peterska2 left column -->
<if condition="$post[fieldX]=='left'">
<td valign="top" width="25%">
<table class="tborder" border="0" width="100%" align="center">
<!-- left column code-->
Left column
<!-- / left column code -->
</table>
</td>
</if>
<!-- / peterska2 left column -->
<td>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="100%" align="center">
<table width="100%" border="0" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
<tr valign="bottom">
<td align="left" style="padding-bottom:3px;">
<if condition="$bbuserinfo[userid]==$journalinfo[journalist_id] AND $journalinfo[status]!=1"><form method="post" action="blogs.php?do=addentry&j=$j">
<a href="blogs.php?$session[sessionurl]do=addentry&j=$j"><img border="0" src="$stylevar[imgdir_button]/newentry.gif" width="100" height="26" alt="$vbphrase[new_entry]" /></a>
</if>
</td>
<td align="right" style="padding-bottom:3px;">
$pgnav
</td>
</tr>
<tr>
<td colspan="2" align="center">
$entrybits
</td>
</tr>
<tr valign="top">
<td align="left" style="padding-top:3px;">
<if condition="$bbuserinfo[userid]==$journalinfo[journalist_id] AND $journalinfo[status]!=1"><form method="post" action="blogs.php?do=addentry&j=$j">
<a href="blogs.php?$session[sessionurl]do=addentry&j=$j"><img border="0" src="$stylevar[imgdir_button]/newentry.gif" width="100" height="26" alt="$vbphrase[new_entry]" /></a>
</if>
</td>
<td align="right" style="padding-top:3px;">
$pgnav
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<!-- peterska2 right column -->
<if condition="$post[fieldX]=='right'">
<td valign="top" width="25%">
<table class="tborder" border="0" width="100%" align="center">
<!-- right column code -->
Right Column
<!-- / right column code -->
</table>
</td>
</if>
<!-- / peterska2 side column -->
</tr>
</table>
<!-- End Column Table -->
<br /><br />
<div class="vbmenu_popup" id="journalopt_menu" style="display:none">
<table cellpadding="4" cellspacing="0" border="0"
style="border-collapse: collapse" bordercolor="#111111">
<if condition="$canview[comments]">
<tr>
<td class="thead">$vbphrase[journal_tools]</td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=showcomments&j=$j">$vbphrase[view_comments]</a></td>
</tr>
</if>
<tr>
<td class="thead">$vbphrase[download]</td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=downloadjournal&j=$j&type=txt">$vbphrase[txt_format]</a></td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=downloadjournal&j=$j&type=xml">$vbphrase[xml_format]</a></td>
</tr>
<if condition="$bbuserinfo[usergroupid]==6">
<tr>
<td class="thead">$vbphrase[admin_tools]</td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=lockjournal&j=$j"><if condition="$journalinfo[status]==1">$vbphrase[unlock_journal]<else />$vbphrase[lock_journal]</if></a></td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=editjournal&j=$j">$vbphrase[edit_journal_settings]</a></td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=delete&j=$j&t=j">$vbphrase[delete_journal]</a></td>
</tr>
</if>
<if condition="$bbuserinfo[userid]==$journalinfo[journalist_id] AND $journalinfo[status]!=1">
<tr>
<td class="thead">$vbphrase[journalist_options]</td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=addentry&j=$j">$vbphrase[new_entry]</a></td>
</tr>
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=editjournal&j=$j">$vbphrase[edit_journal_settings]</a></td>
</tr>
<if condition="$candeleteown[journal]">
<tr>
<td class="vbmenu_option"><a href="blogs.php?do=delete&j=$j&t=j">$vbphrase[delete_journal]</a></td>
</tr>
</if>
</if>
</table>
</div>
<div class="vbmenu_popup" id="journalsearch_menu" style="display:none">
<form action="blogs.php" method="get">
<input type="hidden" name="do" value="searchresults" />
<input type="hidden" name="st" value="6" />
<input type="hidden" name="j" value="$j" />
<table cellpadding="4" cellspacing="1" border="0">
<tr><td class="thead">$vbphrase[search_this_journal]</td></tr>
<tr><td class="vbmenu_option" title="nohilite"><input type="text" name="sk" value="" size="20" maxlength="50" /> <input type="submit" value="Go" class="button" /></td></tr>
<tr><td class="vbmenu_option"><a href="blogs.php?do=search" title="$vbphrase[advanced_journal_search]">$vbphrase[advanced_search]</a></td></tr>
</table>
</form>
</div>
<div class="vbmenu_popup" id="journalrate_menu" style="display:none">
<if condition="$show[voteform]">
<form action="blogs.php?do=ratejournal" method="post">
</if>
<table cellpadding="4" cellspacing="1" border="0">
<if condition="$show[voteform]">
<tr>
<td class="thead">$vbphrase[rate_this_journal]</td>
</tr>
<tr>
<td class="vbmenu_option" title="nohilite">
<div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_5.gif" alt="$vbphrase[excellent]" /><label for="vote5"><input type="radio" name="rating" value="5" />$vbphrase[excellent]</label></div>
<div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_4.gif" alt="$vbphrase[good]" /><label for="vote4"><input type="radio" name="rating" value="4" />$vbphrase[good]</label></div>
<div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_3.gif" alt="$vbphrase[average]" /><label for="vote3"><input type="radio" name="rating" value="3" />$vbphrase[average]</label></div>
<div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_2.gif" alt="$vbphrase[bad]" /><label for="vote2"><input type="radio" name="rating" value="2" />$vbphrase[bad]</label></div>
<div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_1.gif" alt="$vbphrase[terrible]" /><label for="vote1"><input type="radio" name="rating" value="1" />$vbphrase[terrible]</label></div>
</td>
</tr>
<tr>
<td class="vbmenu_option" title="nohilite" align="center">
<input type="hidden" name="j" value="$j" />
<input type="submit" class="button" value="$vbphrase[vote_now]" />
</td>
</tr>
<else />
<tr>
<td class="alt1" nowrap="nowrap"><div class="smallfont">$vbphrase[already_rated]</div></td>
</tr>
</if>
</table>
<if condition="$show[voteform]">
</form>
</if>
</div>
<!-- / NAVBAR POPUP MENUS -->
$footer
</body>
There are two instances of $post[fieldX]. You need to replace the X with the field number that you are using. Also, use radio buttons not checkboxes, as I have coded it to check for the options 'left' and 'right' all in lower case, so please ensure that the options match this exactly.
If this doesn't work, let me know and I'll have another look at it.
Thanks for giving this a go Kerry. I have been playing with it for a few hours now and for some reason it isn't working. I created radio buttons with the options as left and right in lower case. I also changed the field value in the code but niether column appears.
I am beginning to wonder if it has something to do with his modification.
peterska2
05-20-2006, 08:17 PM
try $userinfo[fieldx]in place of$post[fieldx]
Unfortunantly, this too is not working.
peterska2
05-20-2006, 09:09 PM
It's then something to do with the journal hack and it obviously is not happy about standard conditionals. You could take out one or other of the sets and make it a fixed column for all, but I have a feeling that if standard vB conditionals, such as the ones we have tried, do not work, then getting other info in the columns using vB functions is also going to be difficult.
I would go without the column all together. I was just looking for a different way to allow the users the ability to tweak their journals appearance.
I may have a look at the member.php file and see what I can do about adding some of its functionality to the journal code.
Thanks for giving it a look. I was pulling my hair out trying to get it to work.
peterska2
05-20-2006, 09:21 PM
Don't worry, it works perfect, apart from the conditionals. Then it dies.
Let me know what you come up with.
Ok, I am still playing with this. (lol) I have been trying to get what the USER chose, but all it keeps displaying is what I have chosen. This is what I am using:
<if condition="$vbulletin->userinfo['field19']=='1'">THE BOX IS CHECKED<else />not checked so this shows</if>
It works, but it shows MY setting on everyone elses journal. If this is the correct condition for showing the users info, then the page is obviously not identifying the users journal in which I am visiting. How can I work around that or is there another way to write the condition so that it does realize i am seeking the info the user inputed for that value?
Everyone but me should be showing the text "not checked so this shows" since they aren't on my test board physically. However, it shows "THE BOX IS CHECKED" which is my setting.
So far I have tried (unsuccessfully):
<if condition="$post[field19]=Right">Right Selected<else />left defaulted</if>
<if condition="$vbulletin->userinfo[field19]=Right">Right Selected<else />left defaulted</if>
<if condition="$userinfo[field19]=Right">Right Selected<else />left defaulted</if>
Just bumping this so maybe someone will have a suggestion I haven't already tried.
Adrian Schneider
05-26-2006, 02:46 AM
I'm not too familiar with vbJournal, but here is what I found after a quick search:
$entry: contains information of the entry being viewed
$journalinfo: contains information of the user being viewed
[and FYI]:
$bbuserinfo / $vbulletin->userinfo contains information on the current viewer
$post contains information of the current post/poster
Assuming you want information for the journal's owner, you will have to hack the file a bit... the userfield table is not included in the resultsets.
If you want to go ahead with it, I'll show you where to edit it.
That would be great SirAdrian. I am learning as I go, and I figured I was going to have to edit the PHP file, so show away. lol Thanks.
Adrian Schneider
05-26-2006, 08:47 PM
Try this:
https://vborg.vbsupport.ru/showpost.php?p=988444&postcount=2
This is from the latest version....
I will give this a whirl right now. I am running the latest of both vb and the journal, so if it works for you, it should work for me as well. I will let you know. ;)
(Thanks for showing me that thread. I hadn't seen that yet.)
Thanks a great deal SirAdrian. That did the trick.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.