Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Blog Forum
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #1
Blog Forum
This is kinda a useless example, but does show a few XThreads' features.  Following this will give you something similar to the blog example here.

I've also added some additional comments in gray to explain the reasoning behind some parts.

  1. After activating XThreads, add a new forum which will be used as the blog forum.  Use the following XThreads options when adding this forum:
    Template Prefix: blog_ [this will allow us to pull different templates for this forum]
    Show first post on every showthread page: yes
  2. Add this forum's ID to the list of forum IDs pulled for the portal page
  3. Go to AdminCP -> Templates & Style -> Templates -> Global Templates and add the following templates (title with code):
    blog_forumbit_depth2_forum [this will cause the forum to directly link to the portal page (rather than go through a forum redirect) - note that this may make posting new threads more difficult; you can still do it by navigating to the forum via the forum jump dropdown, but yes, this is perhaps not ideal (it's designed more for demonstration here)]

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    <tr>
    <td class="{$bgcolor}" align="center" valign="top" width="1"><img src="{$theme['imgdir']}/{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" /></td>
    <td class="{$bgcolor}" valign="top">
    <strong><a href="portal.php">{$forum['name']}</a></strong>{$forum_viewers_text}<div class="smalltext">{$forum['description']}{$modlist}{$subforums}</div>
    </td><td class="{$bgcolor}" valign="top" colspan="3" style="font-size: smaller;">
    <div>Posts: {$threads}{$unapproved['unapproved_threads']}</div>
    <div>Comments: {$posts}{$unapproved['unapproved_posts']}</div>
    <div>Latest Post: {$lastpost}</div>
    </td>
    </tr>

    blog_forumbit_depth2_forum_lastpost [a problem with this is that if there isn't a post in this forum, the "Never" line won't look right; it's hard coded in MyBB, and no easy solution unfortunately, but shouldn't be a big issue on most forums]

    HTML Code
    <span class="smalltext">
    <a href="{$lastpost_link}" title="{$full_lastpost_subject}"><strong>{$lastpost_subject}</strong></a> at {$lastpost_date} {$lastpost_time} {$lang->by} {$lastpost_profilelink}</span>

    blog_postbit

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    {$ignore_bit}
    <a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
    <div style="padding: 0.2em 0.5em 0em 0.5em; border: 1px solid #e4e4e4; margin: 0.1em 0em;" class="trow2" id="post_{$post['pid']}">
    <div style="font-size: smaller;">
    {$post['inlinecheck']} Comment <a href="{$post['postlink']}#pid{$post['pid']}">#{$postcounter}</a> by {$post['profilelink']} at {$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}">{$post['editedmsg']}</span>
    <span class="post_meta" id="post_meta_{$post['pid']}">
    {$post['iplogged']}
    </span>
    </div>
    <div class="post_management_buttons float_right">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
    </div>
    <div class="post_body" id="pid_{$post['pid']}">
    {$post['message']}
    </div>
    <div class="clear"></div>
    </div>

    blog_postbit_first and blog_postbit_first_classic

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    {$ignore_bit}
    <a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
    <table cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    <tr>
    <td class="thead"><strong>{$post['icon']}{$post['subject']} {$post['subject_extra']}</strong></td>
    </tr>
    <tr>
    <td class="trow2" align="right">
    <span class="smalltext">Posted by {$post['profilelink']}  - {$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}">{$post['editedmsg']}</span></span>
    </td>
    </tr>
    <tr>
    <td class="trow1">
    <table border="0" cellpadding="{$theme['tablespace']}" width="100%">
    	<tr>
    		{$post['useravatar']}
    		<td class="trow1">
    			<div class="post_body" id="pid_{$post['pid']}">
    				{$post['message']}
    			</div>
    			{$post['attachments']}
    			<div class="post_meta" id="post_meta_{$post['pid']}">
    			{$post['iplogged']}
    			</div>
    		</td>
    	</tr>
    	<tr>
    		<td class="trow1 post_buttons {$unapproved_shade}">
    			<div class="author_buttons float_left">
    				{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}
    			</div>
    			<div class="post_management_buttons float_right">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
    			</div>
    		</td>
    	</tr>
    </table>
    </td>
    </tr>
    </table>

    blog_postbit_first_iplogged_hiden

    HTML Code
    <p class="smalltext">{$lang->postbit_ipaddress} <a href="moderation.php?action=getip&amp;pid={$post['pid']}">{$lang->postbit_ipaddress_logged}</a></p>

    blog_postbit_inlinecheck

    HTML Code
    <input type="checkbox" class="checkbox" name="inlinemod_{$post['pid']}" id="inlinemod_{$post['pid']}" value="1" style="vertical-align: middle;" {$inlinecheck}  />

    blog_postbit_iplogged_hiden

    HTML Code
    (<a href="moderation.php?action=getip&amp;pid={$post['pid']}">IP</a>)

    blog_showthread

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    <html>
    <head>
    <title>{$thread['subject']}</title>
    {$headerinclude}
    <script type="text/javascript">
    <!--
    	var quickdelete_confirm = "{$lang->quickdelete_confirm}";
    // -->
    </script>
    <script type="text/javascript" src="jscripts/thread.js?ver=1400"></script>
    </head>
    <body>
    	{$header}
    	{$pollbox}
    
    {$first_post}
    	<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top-width: 0;">
    		<tr>
    			<td colspan="2" class="tfoot">
    				<div>
    					<strong>&laquo; <a href="{$next_oldest_link}">{$lang->next_oldest}</a> | <a href="{$next_newest_link}">{$lang->next_newest}</a> &raquo;</strong>
    				</div>
    			</td>
    		</tr>
    	</table>
    
    
    <br clear="all" />
    	<div class="float_right">
    		{$newreply}
    	</div>
    <h2 style="margin-top: 0;">Comments</h2>
    
    	<div id="posts" style="clear: both; margin-left: 1em; margin-right: 1em;">
    		{$posts}
    	</div>
    <div class="clear"><br /></div>
    	<div class="float_left">
    		{$multipage}
    	</div>
    	<div style="padding-top: 4px;" class="float_right">
    		Search Comments: &nbsp; {$search_thread}
    	</div>
    	<br style="clear: both;" />
    	{$quickreply}
    	{$threadexbox}
    	{$similarthreads}
    	<br />
    	<div class="float_left">
    		<ul class="thread_tools">
    			<li class="printable"><a href="printthread.php?tid={$tid}">{$lang->view_printable}</a></li>
    			<li class="sendthread"><a href="sendthread.php?tid={$tid}">{$lang->send_thread}</a></li>
    			<li class="subscription_{$add_remove_subscription}"><a href="usercp2.php?action={$add_remove_subscription}subscription&amp;tid={$tid}">{$add_remove_subscription_text}</a></li>
    		</ul>
    	</div>
    
    	<div class="float_right" style="text-align: right;">
    		{$moderationoptions}
    		{$forumjump}
    	</div>
    	<br style="clear: both;" />
    	{$footer}
    </body>
    </html>

    blog_showthread_noreplies

    HTML Code
    <div id="xthreads_noreplies">
    There are no comments on this post.
    </div>

  4. Go to your blog forum and check that everything works correctly.


Again, kinda stupid, but might show you some things.  And I know there's a number of problems with this example, including me being a crappy HTML/CSS designer.
Hope this was useful to someone.

My Blog
05-04-2010 04:40 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Blog Forum - ZiNgA BuRgA - 05-04-2010 04:40 PM
RE: Blog Forum - wnd - 08-04-2010, 06:16 AM
RE: Blog Forum - ZiNgA BuRgA - 08-05-2010, 08:25 PM
RE: Blog Forum - RocketFoot - 10-13-2010, 12:48 AM
RE: Blog Forum - leefish - 10-13-2010, 01:31 AM
RE: Blog Forum - techu - 10-13-2010, 02:30 AM
RE: Blog Forum - leefish - 10-13-2010, 03:54 AM
RE: Blog Forum - TriTop - 10-13-2010, 05:05 AM
RE: Blog Forum - leefish - 10-13-2010, 06:00 AM
RE: Blog Forum - RocketFoot - 10-13-2010, 10:18 AM
RE: Blog Forum - ZiNgA BuRgA - 10-13-2010, 10:42 AM
RE: Blog Forum - leefish - 10-13-2010, 11:04 AM
RE: Blog Forum - RateU - 10-14-2010, 06:04 AM
RE: Blog Forum - 1master1 - 10-21-2010, 06:34 AM
RE: Blog Forum - techu - 10-21-2010, 12:22 PM
RE: Blog Forum - ZiNgA BuRgA - 10-21-2010, 07:36 AM
RE: Blog Forum - kyuubie - 01-17-2012, 11:41 PM
RE: Blog Forum - RateU - 01-18-2012, 03:46 AM
RE: Blog Forum - kyuubie - 01-18-2012, 11:25 PM
RE: Blog Forum - kyuubie - 01-24-2012, 12:15 AM
RE: Blog Forum - RateU - 01-24-2012, 01:55 AM
RE: Blog Forum - kyuubie - 01-24-2012, 10:59 AM
RE: Blog Forum - ZiNgA BuRgA - 01-24-2012, 12:07 PM
RE: Blog Forum - bekti - 10-11-2012, 09:58 PM
RE: Blog Forum - RateU - 10-13-2012, 01:49 AM
RE: Blog Forum - webtester - 06-12-2013, 06:14 PM
RE: Blog Forum - ZiNgA BuRgA - 06-13-2013, 09:25 AM
RE: Blog Forum - Mark2x - 12-22-2014, 02:05 PM
RE: Blog Forum - kel - 06-19-2015, 06:56 AM
RE: Blog Forum - xensor - 11-18-2015, 04:48 PM
RE: Blog Forum - RateU - 11-19-2015, 01:12 AM

 Standard Tools
Forum Jump: