| View previous topic :: View next topic |
| Author |
Message |
admin (no pm's please) Site Admin

 Virtual Cash: 46240
Joined: 22 May 2005 Posts: 19680
Add Karma
 rated by 164 members
Add Comment
Show Comments
 |
Posted: Wed Sep 12, 2007 4:45 pm Post subject: Tweaking the viewtopic_body.tpl for the blog view |
|
|
When using the new blog forums, the viewing comment link will take you the standard topic thread that uses the viewtopic_body.tpl file. This is functionally correct, but the look does not match the blog template style.
This can be solved fairly easily with some edits to viewtopic_body.tpl.
Remember all templates differ, so this is talking in general terms.
At the top of viewtopic_body.tpl there are two tables for pagination and the forum links. We want the topic of the blog to show beneath that point. So under | of the second table we add:
| Code: |
<!-- BEGIN postrow -->
<!-- IF S_BLOGVIEW == 1 && postrow.POST_NUMBER == 1 -->
<div class="forumbg forumbg-table">
<div class="inner"><span class="corners-top"><span></span></span>
<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0">
<tr>
<td width="150" align="left" valign="top" ><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}</span><br /></td>
<td width="100%" height="28" valign="top" nowrap="nowrap"><table cellspacing="0" cellpadding="0" border="0" height="18" width="18">
<tr>
<td valign="middle" nowrap="nowrap">{postrow.PROFILE_IMG} {postrow.PM_IMG} {postrow.EMAIL_IMG} {WWW_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG}<script language="JavaScript" type="text/javascript"><!--
if ( navigator.userAgent.toLowerCase().indexOf('mozilla') != -1 && navigator.userAgent.indexOf('5.') == -1 && navigator.userAgent.indexOf('6.') == -1 )
document.write(' {ICQ_IMG}');
else
document.write('</td><td> </td><td valign="top" nowrap="nowrap"><div style="position:relative"><div style="position:absolute">{postrow.ICQ_IMG}</div><div style="position:absolute;left:3px;top:-1px">{ICQ_STATUS_IMG}</div></div>');
//--></script><noscript>{postrow.ICQ_IMG}</noscript></td>
</tr>
<tr><td><h2><a name="{postrow.U_POST_ID}"></a>A Blog by - {postrow.POSTER_NAME}</h2><br />{postrow.POSTER_AVATAR}</td></tr>
</table></td>
</tr>
<tr>
<td class="{postrow.ROW_CLASS}" colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
</tr>
</table>
<span class="corners-bottom"><span></span></span>
</div></div>
<!-- ENDIF -->
<!-- END postrow -->
|
This is a loop through all the posts with a test:
<!-- IF S_BLOGVIEW == 1 && postrow.POST_NUMBER == 1 -->
This test asks first is we are looking at a blog topic, and then if the post is the very first post in the thread. If it is then we show the post formatted blog style.
Next at the start of the next table which holds the posts, I replace the first row with:
| Code: |
<!-- IF S_BLOGVIEW != 1 -->
<tr align="right">
<td class="catHead" colspan="2" height="28"><span class="nav"><a href="{U_VIEW_OLDER_TOPIC}" class="nav">{L_VIEW_PREVIOUS_TOPIC}</a> :: <a href="{U_VIEW_NEWER_TOPIC}" class="nav">{L_VIEW_NEXT_TOPIC}</a> </span></td>
</tr>
<!-- ENDIF -->
|
All I am doing here is preventing the "view next" and "view prev" topic links appearing in blog view. I don't think they work well in blog view.
Next add a new line after:
<!-- BEGIN postrow -->
| Code: |
<!-- IF S_BLOGVIEW != 1 || postrow.POST_NUMBER > 1 -->
|
This is the complement of showing the first post blog style. This time round we want to not show the post. This avoids the first post displaying twice.
Lastly after:
<!-- END postrow -->
We add:
This code is slightly simplified in that on this forum the tables need a few divs to add the fancy borders. With other templates there may be other little issues like that.
The key is that the macros:
{postrow.POST_NUMBER} thread post number 1 for first post
and
{S_BLOGVIEW} blog view 1 for blog view
are there to be used as you see fit.
_________________
Family Friendly Shareware | | Web Design/Services | Free Forums
forum.myfreeforum.org |
|
| Back to top |
|
 |
archers-rest Craftsman

 Virtual Cash: 550
Joined: 01 Nov 2006 Posts: 405
Add Karma
 rated by 1 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
Symon Moderator

 Virtual Cash: 28730
Joined: 04 Sep 2005 Posts: 11158 Location: Hampshire,England Add Karma
 rated by 85 members
Add Comment
Show Comments
 |
Posted: Fri Sep 14, 2007 3:55 pm Post subject: |
|
|
| archers-rest wrote: | Sorry couldnt follow that at all, good job I have a back up Wheres Symon and his walk through  |
Well i have made the edits on my test forum but see no change from unedited viewtopic to the edited view topic ?
But i will do a wlakthough. _________________
http://www.saynoto0870.com/
http://www.myshopbag.co.uk
XXVIII/ I/ MCMLXXI |
|
| Back to top |
|
 |
admin (no pm's please) Site Admin

 Virtual Cash: 46240
Joined: 22 May 2005 Posts: 19680
Add Karma
 rated by 164 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
Symon Moderator

 Virtual Cash: 28730
Joined: 04 Sep 2005 Posts: 11158 Location: Hampshire,England Add Karma
 rated by 85 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
Symon Moderator

 Virtual Cash: 28730
Joined: 04 Sep 2005 Posts: 11158 Location: Hampshire,England Add Karma
 rated by 85 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
admin (no pm's please) Site Admin

 Virtual Cash: 46240
Joined: 22 May 2005 Posts: 19680
Add Karma
 rated by 164 members
Add Comment
Show Comments
 |
Posted: Fri Sep 14, 2007 6:04 pm Post subject: |
|
|
Okay,
The edits are wrong, you have created a postrow loop with
<!-- IF S_BLOGVIEW != 1 || postrow.POST_NUMBER > 1 -->
<!-- IF S_BLOGVIEW == 1 && postrow.POST_NUMBER == 1 -->
at the start. This should just be:
<!-- IF S_BLOGVIEW == 1 && postrow.POST_NUMBER == 1 -->
on the second original postrow loop you need:
<!-- IF S_BLOGVIEW != 1 || postrow.POST_NUMBER > 1 --> _________________
Family Friendly Shareware | | Web Design/Services | Free Forums
forum.myfreeforum.org |
|
| Back to top |
|
 |
Symon Moderator

 Virtual Cash: 28730
Joined: 04 Sep 2005 Posts: 11158 Location: Hampshire,England Add Karma
 rated by 85 members
Add Comment
Show Comments
 |
Posted: Fri Sep 14, 2007 6:12 pm Post subject: |
|
|
| admin (no pm's please) wrote: | Okay,
The edits are wrong, you have created a postrow loop with
<!-- IF S_BLOGVIEW != 1 || postrow.POST_NUMBER > 1 -->
<!-- IF S_BLOGVIEW == 1 && postrow.POST_NUMBER == 1 -->
at the start. This should just be:
<!-- IF S_BLOGVIEW == 1 && postrow.POST_NUMBER == 1 -->
on the second original postrow loop you need:
<!-- IF S_BLOGVIEW != 1 || postrow.POST_NUMBER > 1 --> |
Ok i sorted that but i see no difference so either i have edited major wrong or i,m going blind.
edited version of viewtopic is
_________________
http://www.saynoto0870.com/
http://www.myshopbag.co.uk
XXVIII/ I/ MCMLXXI |
|
| Back to top |
|
 |
admin (no pm's please) Site Admin

 Virtual Cash: 46240
Joined: 22 May 2005 Posts: 19680
Add Karma
 rated by 164 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
Symon Moderator

 Virtual Cash: 28730
Joined: 04 Sep 2005 Posts: 11158 Location: Hampshire,England Add Karma
 rated by 85 members
Add Comment
Show Comments
 |
Posted: Fri Sep 14, 2007 6:31 pm Post subject: |
|
|
| admin (no pm's please) wrote: | | Both guest and editor seemed to be on template2 where template1 has the edits. |
Sorry that was me i kept switching trying to see a difference and i still can not. are the edits correct now ? if so i can provide screen shots _________________
http://www.saynoto0870.com/
http://www.myshopbag.co.uk
XXVIII/ I/ MCMLXXI |
|
| Back to top |
|
 |
admin (no pm's please) Site Admin

 Virtual Cash: 46240
Joined: 22 May 2005 Posts: 19680
Add Karma
 rated by 164 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
Symon Moderator

 Virtual Cash: 28730
Joined: 04 Sep 2005 Posts: 11158 Location: Hampshire,England Add Karma
 rated by 85 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
Symon Moderator

 Virtual Cash: 28730
Joined: 04 Sep 2005 Posts: 11158 Location: Hampshire,England Add Karma
 rated by 85 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
admin (no pm's please) Site Admin

 Virtual Cash: 46240
Joined: 22 May 2005 Posts: 19680
Add Karma
 rated by 164 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
archers-rest Craftsman

 Virtual Cash: 550
Joined: 01 Nov 2006 Posts: 405
Add Karma
 rated by 1 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |