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
wnd Offline
Junior Member
**
Posts: 8
Joined: May 2010
Post: #2
RE: Blog Forum
It's not too shabby...

One improvement that I've made: if you have the PHP in Templates plugin, use the following code for blog_forumbit_depth2_forum:

Code:
1
2
3
4
5
6
7
8
9
10
11
<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>
<?php $comments=$posts-$threads ?>
<div>Comments: {$comments}{$unapproved['unapproved_posts']}</div>
<div>Latest Post: {$lastpost}</div>
</td>
</tr>


That way the number of comments doesn't include the number of posts.

08-04-2010 06:16 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #3
RE: Blog Forum
Thanks for that wnd.

My Blog
08-05-2010 08:25 PM
Find all posts by this user Quote this message in a reply
RocketFoot Offline
Senior Member
****
Posts: 338
Joined: Jul 2010
Post: #4
RE: Blog Forum
Will this example create a blog forum similar to this demo blog?

http://mynie.6te.net/demo/xtblog.php

I like the way that it is set up!
(This post was last modified: 10-13-2010 12:48 AM by RocketFoot.)
10-13-2010 12:48 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #5
RE: Blog Forum
(10-13-2010 12:48 AM)RocketFoot Wrote:  Will this example create a blog forum similar to this demo blog?

http://mynie.6te.net/demo/xtblog.php

I like the way that it is set up!

I don't think it will - looking at the link name ending in xtblog.php I think the supersmart RateU has made a custom page. I can make a custom page but I can't get any dynamic content to show.... THAT would be a good tutorial.


[Image: leelink.gif]
MYBB1.6 & XThreads
10-13-2010 01:31 AM
Visit this user's website Find all posts by this user Quote this message in a reply
techu Offline
Member
***
Posts: 154
Joined: Sep 2010
Post: #6
RE: Blog Forum
(10-13-2010 01:31 AM)leefish Wrote:  
(10-13-2010 12:48 AM)RocketFoot Wrote:  Will this example create a blog forum similar to this demo blog?

http://mynie.6te.net/demo/xtblog.php

I like the way that it is set up!

I don't think it will - looking at the link name ending in xtblog.php I think the supersmart RateU has made a custom page. I can make a custom page but I can't get any dynamic content to show.... THAT would be a good tutorial.

I dont think he made a custom page, obviously he used xthread.

I thing what he did was he added a url rewrite rule to his .htaccess

example:

Code:
RewriteRule ^xtblog\.php$  forumdisplay.php?fid=<the forum id>



I also use similar kind of rewrite in my forum for contact us:
demo: http://www.techedze.com/contactus.html

Code:
RewriteRule ^contactus\.html$  newthread.php?fid=45


[Image: banner.png]
10-13-2010 02:30 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #7
RE: Blog Forum
hmm, Thats a neat idea, in fact, its an AWESOME idea.....

Sadly, I know nothing of these rewrite rules. Frown


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 10-13-2010 03:56 AM by leefish.)
10-13-2010 03:54 AM
Visit this user's website Find all posts by this user Quote this message in a reply
TriTop Offline
Member
***
Posts: 53
Joined: Apr 2008
Post: #8
RE: Blog Forum
Begin reading leefish. Wink
Introduction to mod_rewrite

Puh...It's not that easy. Lots to read.
10-13-2010 05:05 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #9
RE: Blog Forum
(10-13-2010 05:05 AM)TriTop Wrote:  Begin reading leefish. Wink
Introduction to mod_rewrite

Puh...It's not that easy. Lots to read.

Um, thanks for that. I don't want it THAT much....


[Image: leelink.gif]
MYBB1.6 & XThreads
10-13-2010 06:00 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RocketFoot Offline
Senior Member
****
Posts: 338
Joined: Jul 2010
Post: #10
RE: Blog Forum
LOL...

Yeah, I like the way rateU did the blog.  I have a plugin blog but it kind of sucks...I have to use a generic RSS importer to create auto posts in the forums.  I might use X-Threads Blog if I could make it look very much like RateU's version!
10-13-2010 10:18 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: