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.
HTML Code:
$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.)
|