[RC] Similar Topics 1.0.2

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Anti-Spam Guide
durafoam
Registered User
Posts: 4
Joined: Wed Feb 25, 2009 12:23 am

Re: [RC] Similar Topics 1.0.1

Post by durafoam »

I greatly improved the HTML code on this mod--so that it fits the style of the prosilver template for the PHPBB forum much better now. For this to function, two edits must be done on the mysql query so that the number of views can be displayed with the associated topic. The end result is fairly similar to the style the phpbb-seo.com forums use at the end of each post ("similar topics").

Here's a demo of the result; make sure to scroll to the bottom of the page to view a demo for "Similar topics".:
Demo (how can I make this target="_blank"? oh well..)



Replace the html on this page styles/prosilver/template/viewtopic_body.html, first find this:

Code: Select all

<!-- IF .similar -->
<br />
<h3>{L_SIMILAR_TOPICS}</h3>
<div class="post bg1">
	<div class="inner">
		<span class="corners-top"><span></span></span>
			<table width="100%">
			<tr>
				<!-- BEGIN similar -->
				<td valign="top"><a href="{similar.U_TOPIC}" class="topictitle">{similar.TOPIC_TITLE}</a><br />
					{L_FORUM}: <a href="{similar.U_FORUM}">{similar.FORUM}</a><br />
					{L_AUTHOR}: {similar.USER}<br />
					{L_REPLIES}: {similar.REPLIES}<br />
				</td>
				<!-- END similar -->
			</tr>
			</table>
			<div class="back2top"><a href="#wrap" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>
		<span class="corners-bottom"><span></span></span>
	</div>
</div>
<br />
<!-- ENDIF -->
Then replace it with my modified version of the code:

Code: Select all

<!-- IF .similar -->
		<div class="forumbg announcement">
		<div class="inner"><span class="corners-top"><span></span></span>
		<ul class="topiclist">
			<li class="header">
				<dl class="icon">
					<dt>{L_SIMILAR_TOPICS}</dt>
					<dd class="posts">Replies</dd>
					<dd class="views">Views</dd>

					<dd class="lastpost"><span>Last post</span></dd>
				</dl>
			</li>
		</ul>
		<ul class="topiclist topics">
<!-- BEGIN similar -->	
		<li class="row bg1">
			<dl class="icon" style="background-image: url(./styles/prosilver/imageset/announce_read_mine.gif); background-repeat: no-repeat;">
				<dt title="No new posts"><a href="{similar.U_TOPIC}" class="topictitle">{similar.TOPIC_TITLE}</a></dt>
				<dd class="posts">{similar.REPLIES} <dfn>Replies</dfn></dd>
				<dd class="views">{similar.VIEWS} <dfn>Views</dfn></dd>
				<dd class="lastpost"><span><dfn>Last post </dfn>by {similar.USER} <br /> 
				<a href="{similar.U_FORUM}">{similar.FORUM}</a></span>
				</dd>
			</dl>
		</li>
<!-- END similar -->
			</ul>
		<span class="corners-bottom"><span></span></span></div>
	</div>
<!-- ENDIF -->
<!-- IF S_DISPLAY_ONLINE_LIST -->
	<h3><!-- IF U_VIEWONLINE --><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a><!-- ELSE -->{L_WHO_IS_ONLINE}<!-- ENDIF --></h3>
	<p>{LOGGED_IN_USER_LIST}</p>
<!-- ENDIF -->
Personally, I prefer putting this after the jumpbox and moderator box, but before the rest of the footer:

Code: Select all

<!-- INCLUDE jumpbox.html -->

<!-- IF S_TOPIC_MOD -->
	<form method="post" action="{S_MOD_ACTION}">
	<fieldset class="quickmod">
		<label for="quick-mod-select">{L_QUICK_MOD}:</label> {S_TOPIC_MOD} <input type="submit" value="{L_GO}" class="button2" />
		{S_FORM_TOKEN}
	</fieldset>
	</form>
<!-- ENDIF -->
And now for the final step...
(add the number of topic views to the SQL query, so it will work in the template)
go to viewtopic.php and replace this:

Code: Select all

'SELECT'	=> 'f.forum_id, f.forum_name, t.topic_id, t.topic_title, u.user_id, u.username, u.user_colour, t.topic_replies',
with this:

Code: Select all

'SELECT'	=> 'f.forum_id, f.forum_name, t.topic_id, t.topic_title, u.user_id, u.username, u.user_colour, t.topic_replies, t.topic_views',
And then find:

Code: Select all

'REPLIES'				=> $similar['topic_replies'],
and insert this after (on the following line):

Code: Select all

				'VIEWS' 				=> $similar['topic_views'],
Make sure everything is saved & uploaded (only 2 pages need edits for this to work:
1-styles/prosilver/template/viewtopic_body.html
2-viewtopic.php

Now to view your changes don't forget to refresh the template:
Go to your styles tab in the ACP, or "administrator control panel", then select your template, and choose "refresh", then click yes.... you should now be able to view the edits.
And it should be working just like the demo at the top of this post.

On a final note, I hope the author of this mod is willing to adopt these improvements I've made here! Check my demo (link above), and I'm sure you'll agree this is a nice improvement!

joebart72
Registered User
Posts: 743
Joined: Thu Feb 01, 2007 5:54 am

Re: [RC] Similar Topics 1.0.1

Post by joebart72 »

I've installed this mod ans it's very great but just one thing about wrap to top :

If you want to got o the top of viewtopic, you must add this :

Code: Select all

<div class="back2top"><a href="{U_VIEW_TOPIC}#wrap" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>
Instead of :

Code: Select all

<div class="back2top"><a href="#wrap" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>


If not, you come back ton index page...

;)
I learn English with phpbb.com :)

User avatar
Pardis
Translator
Posts: 108
Joined: Sat Jun 21, 2008 11:14 pm

Re: [RC] Similar Topics 1.0.1

Post by Pardis »

Thanks alot dear joebart72,but I test this mod and works fine (No error in clicking on related topics links)

Can you explain more brief about this change ?

joebart72
Registered User
Posts: 743
Joined: Thu Feb 01, 2007 5:54 am

Re: [RC] Similar Topics 1.0.1

Post by joebart72 »

Yes of course :) In fact on my board, if I click on the little icon "back to top", I go back on index page instead of the top of my topic. Not with my changes... :D
I learn English with phpbb.com :)

Fliggerty
Registered User
Posts: 90
Joined: Fri Jul 11, 2008 11:01 pm

Re: [RC] Similar Topics 1.0.1

Post by Fliggerty »

I've installed this and had it running for a few months now. About the same time I, I also installed an Ajax chat script which gets heavy use on my site. Shortly after this, I was contacted by my web host informing me that I was using far too much of the CPU on the shared server my site is hosted on. Rather than remaining below the alloted 1%, my site consistently uses 5-7%.

I have since removed the chat (much to the dismay of my members!) and turned off the display of this mod in the ACP. I am still having CPU issues though, my account is on the verge of being supsended for violating TOS.

I suspect that even though the display for this is turned off, it still performs the search each time viewtopic.php is called, correct? The Apache module server_status shows that a lot of the load is coming from viewtopic.php.

So I am curious if anyone else using this mod has similar issues. I think I will entirely remove this mod tomorrow and see if it improves anything. Shame though.

DanielaK
Registered User
Posts: 20
Joined: Fri Jan 16, 2009 5:06 am

Re: [RC] Similar Topics 1.0.1

Post by DanielaK »

Hi there,

i've tried to install this on my test forum. Unfortunately I can't see any changes. After clearing the cache and refreshing the template and checking the sql.

It looks like this now:

Image

User avatar
zake black
Registered User
Posts: 694
Joined: Fri Jan 23, 2009 8:34 am
Location: Milton Keynes (UK)
Contact:

Re: [RC] Similar Topics 1.0.2

Post by zake black »

Any one running this that can offer me an english example?

Cheers

Andy

User avatar
zake black
Registered User
Posts: 694
Joined: Fri Jan 23, 2009 8:34 am
Location: Milton Keynes (UK)
Contact:

Re: [RC] Similar Topics 1.0.2

Post by zake black »

zake black wrote:Any one running this that can offer me an english example?

Cheers

Andy
Ok no worry, i installed on test and have now implemented on live.

thanks to durafoam for his modifications. fits in well..

Great mod cheers

User avatar
zake black
Registered User
Posts: 694
Joined: Fri Jan 23, 2009 8:34 am
Location: Milton Keynes (UK)
Contact:

Re: [RC] Similar Topics 1.0.2

Post by zake black »

Sorry just thought of somthing..

Is it possible to control how many results are displayed?

Cheers

Andy

User avatar
tas2580
Registered User
Posts: 295
Joined: Wed May 30, 2007 1:56 am
Location: Stuttgart, Germany
Contact:

Re: [RC] Similar Topics 1.0.2

Post by tas2580 »

Find

Code: Select all

if ($result = $db->sql_query_limit($sql, 5)) 
Replace the 5 with the number of topics you wish.

User avatar
zake black
Registered User
Posts: 694
Joined: Fri Jan 23, 2009 8:34 am
Location: Milton Keynes (UK)
Contact:

Re: [RC] Similar Topics 1.0.2

Post by zake black »

tas2580 wrote:Find

Code: Select all

if ($result = $db->sql_query_limit($sql, 5)) 
Replace the 5 with the number of topics you wish.

Cool thanks

Edit, Sorry which file is this edit in?

Edit: sorry, found it. viewtopic.php

User avatar
Professional
Registered User
Posts: 187
Joined: Mon Jan 21, 2008 2:40 pm

Re: [RC] Similar Topics 1.0.2

Post by Professional »

hi i want to use this mod at my seo board (http://www.mobile4persian.com/) that using ultimate seo mod from (http://downloads.phpbb-seo.com/phpbb-se ... rl-38.html) how can i change urls to work with that?
tnx :)
انجمن تخصصی نسل جدید موبایل ها
My Mobile Forum: M4P Forum
Every Thing That U Feel,Is Every Thing That I Feel.

User avatar
knmt
Registered User
Posts: 110
Joined: Fri Aug 29, 2008 10:13 am
Contact:

Re: [RC] Similar Topics 1.0.2

Post by knmt »

Oh hi there Professional, I know you on phpbb-seo forum.

Why don't you create a topic on that forum instead?

Anyway, here: http://www.phpbb-seo.com/en/phpbb-mod-r ... e4750.html :roll:

User avatar
Professional
Registered User
Posts: 187
Joined: Mon Jan 21, 2008 2:40 pm

Re: [RC] Similar Topics 1.0.2

Post by Professional »

knmt wrote:Oh hi there Professional, I know you on phpbb-seo forum.

Why don't you create a topic on that forum instead?

Anyway, here: http://www.phpbb-seo.com/en/phpbb-mod-r ... e4750.html :roll:
hi,thank u. :)
now i want to just test it because the seo simlar topic mod will release soon ;)
انجمن تخصصی نسل جدید موبایل ها
My Mobile Forum: M4P Forum
Every Thing That U Feel,Is Every Thing That I Feel.

User avatar
knmt
Registered User
Posts: 110
Joined: Fri Aug 29, 2008 10:13 am
Contact:

Re: [RC] Similar Topics 1.0.2

Post by knmt »

Yup but this mod is fine enough, you can also use the precise similar topic, which is also a mod somewhere on this board. It bases on this one though.

Locked

Return to “[3.0.x] MODs in Development”