[ABD] Topic preview [/]

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! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
clight77
Registered User
Posts: 907
Joined: Sun May 11, 2003 11:09 pm

Post by clight77 » Fri Nov 05, 2004 3:13 am

Hi all.
Is there anyway to get this Addit mod to work in phpbb plus v1.52?

All is fine till the template viewforum_body.tpl, it is totally different in phpbb plus 1.52

Thanks :D

clight77
Registered User
Posts: 907
Joined: Sun May 11, 2003 11:09 pm

Working for phpbb plus v1.52

Post by clight77 » Fri Nov 05, 2004 6:42 am

MODIFIED FOR phpbb plus v1.52
Tested and working thanks to rva and clight77


Quote: › Select ›‹ Contract
MOD Title: Topic Preview
## MOD Author: Addit < adam_marcus@btinternet.com > (Adam Marcus) N/A
## MOD Description: This mod adds an alt that shows the first 255 characters of a topic
## when user moves the cursor over the topic title in forum view.
## MOD Version: 1
##
## Installation Level: Easy
## Installation Time: ~5 Minutes
## Files To Edit:
## includes/functions_topics_list.php
## templates/***/topics_list_box.tpl
##
##
## Included Files: N/A
##
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
## A simple solution without reverting to javascript.
##############################################################
## MOD History:
##
## 2004-06-05 - Version 1
## - First release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#----------[ OPEN ]-------------------------------------------
#
includes/functions_topics_list.php
#
#----------[ FIND ]-------------------------------------------
#
$views = $topic_rowset[$i]['topic_views'];
#---------[ BEFORE, ADD ]-------------------------------------
// topic preview mod start -------->

// get first post of topic
$sql = "SELECT post_text FROM " . POSTS_TEXT_TABLE . " WHERE post_id=" . $topic_rowset[$i]['topic_first_post_id'];
$post_result = $db->sql_query($sql);
$post_row = $db->sql_fetchrow($post_result);
$db->sql_freeresult($post_result);

// replace html tags and trim length to 255
$summary = $post_row['post_text'];
if (strlen($summary) > 252) $summary=substr($summary,0,252) . "...";
$summary = preg_replace("/\[.+\]/iU",'',$summary);
$summary = htmlspecialchars(strip_tags($summary));

// <--------- topic preview mod end

#
#----------[ FIND ]-------------------------------------------
#
'TOPIC_TITLE' => $topic_title,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'TOPIC_SUMMARY' => $summary,
#
#----------[ OPEN ]-------------------------------------------
#
templates/***/topics_list_body.tpl (in 1.52 plus this file is same for all, alter 1 and paste to rest)
#
#-----[ FIND ]------------------------------------------------
#
# "{topics_list_box.row.U_VIEW_TOPIC}"

[After add]
title="{topics_list_box.row.TOPIC_SUMMARY}"
#

#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
Last edited by clight77 on Fri Nov 05, 2004 7:45 am, edited 1 time in total.

User avatar
onigumo
Registered User
Posts: 1755
Joined: Fri Oct 31, 2003 2:32 am
Contact:

Post by onigumo » Fri Nov 05, 2004 6:49 am

I've tried to install this MOD and another one that gives one the same function desired, but have been unable to get it to work due to Category Heirarchy. It replaces what I'm looking for into topic_box.tpl, and though I find what I'm looking for there and replace the code accordingly, I still can't get the MOD to work. I'll contact the author and post my question there.

Anyways, nice MOD.
I write articles on community building
@ The Infinity Program.

clight77
Registered User
Posts: 907
Joined: Sun May 11, 2003 11:09 pm

Post by clight77 » Fri Nov 05, 2004 6:56 am

I use Category Heirarchy and it works fine for me.

This is the Addit code.........

Remember I am using phpbb plus v1.52 fully modded tho..

User avatar
onigumo
Registered User
Posts: 1755
Joined: Fri Oct 31, 2003 2:32 am
Contact:

Post by onigumo » Fri Nov 05, 2004 7:29 am

Oh -- I meant viewforum_topicbox.tpl (if I recall correctly).

It's the code I insert in there, and I insert it correctly, yet the MOD won't work.

By the way, I'm using a regular installation of 2.0.8.
I write articles on community building
@ The Infinity Program.

clight77
Registered User
Posts: 907
Joined: Sun May 11, 2003 11:09 pm

Post by clight77 » Fri Nov 05, 2004 7:36 am

In your case it is templates/viewforum_body.tpl
and viewtopic.php.

Other than that I am no help..
Sorry :?

clight77
Registered User
Posts: 907
Joined: Sun May 11, 2003 11:09 pm

Post by clight77 » Fri Nov 05, 2004 7:39 am

One more suggestion, after installing this Mod, close/exit and reopen your forums. As many times Mods will not work untill a fresh start of your board..

User avatar
onigumo
Registered User
Posts: 1755
Joined: Fri Oct 31, 2003 2:32 am
Contact:

Post by onigumo » Fri Nov 05, 2004 7:44 am

Regarding your second post: good suggestion. I plan on retrying the installation of the MOD, and I'll be sure to follow that suggestion of yours.

Regarding your first post: In my case, it isn't, because what I'm looking for in viewforum_body.tpl has been replaced with a piece of code by which the installation of Category Heirarchy had required to be put in place of. The code I'm looking for can now be found in viewforum_topicbox.tpl (if I remember the name of the file correctly). I inserted the code there.
I write articles on community building
@ The Infinity Program.

clight77
Registered User
Posts: 907
Joined: Sun May 11, 2003 11:09 pm

Post by clight77 » Fri Nov 05, 2004 7:56 am

I had problems with this Mod also but eventually got it to work.
That is why I posted my fix code..

Have you altered includes/functions_topics_list.php instead of viewtopic.php ? If you have altered both, undo viewtopic.php.

Wish I could help more...

MervynG
Registered User
Posts: 31
Joined: Sat Jan 01, 2005 10:07 am

Post by MervynG » Sat Jan 01, 2005 5:26 pm

Hi Guys,

I am a newbie and still trying to figure out how this php stuff works.
I have implemented the topic preview (Eman Version).

I have a few other mods including the calender mod on the forum that
I have been busy working on.

I have come up with a slight problem cos part of the code from this
mod also somehow gets called while the calender screen opens. I don't
mind it being called and I have an idea of how to fix it, but can't seem to
figure out the syntax of how to code it.

This is the original piece of code :

Code: Select all

function popup(msg,bak){ 
   var content="<TABLE  WIDTH=400 BORDER=1 BORDERCOLOR=#664500 CELLPADDING=2 CELLSPACING=0 "+"BGCOLOR=:#DEE3E7><tr><TD><FONT COLOR=black SIZE=2 face=verdana>"+msg+"</FONT></TD></tr></TABLE>"; 
   if(!old){ yyy=Yoffset; skn.innerHTML=content; skn.style.visibility="visible"} 
} 
This pops up the preview of the post topic highlighted.
How do I code inside the function to state that if the 'msg' field is null or empty, that the preview window stays hidden and not visible.

If I can get this, it would solve my problem. Hope someone can help.

TIA

Nervyn

ludedude
Registered User
Posts: 229
Joined: Fri Dec 12, 2003 9:24 pm
Location: Nova Scotia, Canada

Post by ludedude » Wed Jan 05, 2005 7:06 am

How about one that works with the new CH2.11

MervynG
Registered User
Posts: 31
Joined: Sat Jan 01, 2005 10:07 am

Post by MervynG » Tue Jan 18, 2005 10:39 am

hi guys,

can the preview mod also be converted to show a preview using the subsilver theme for the preview box? If so, can anyone show me what needs to be modified.

thanx
Mervyn

Thallium
Registered User
Posts: 395
Joined: Mon Aug 30, 2004 12:30 am
Contact:

Post by Thallium » Sun Jan 23, 2005 11:35 pm

Okay, I'm using the one without all the db modifications - primarily because my functions_post is getting so crowded in those lines that the last mod I added which used those functions took over a day to hammer out.

Anyway, the little one works fine, except I'm only getting the first few characters of the first post. Like maybe 12 char. instead of 255. 8O I'm using another one which adds to the title of that link too though, the one which displays the topic started on date. The date appears correctly, whether it's before the summary or after in the title. Just can't seem to get more than a few characters showing from the summary, and the '...' is missing altogether.

Little help? :D
Complete phpBB powered websites, Mods/Hacks installed, unique templates, updates and repairs... reasonable. Email, PM or IM.

neuropower
Registered User
Posts: 1
Joined: Thu Mar 03, 2005 7:38 am

non-breaking spaces

Post by neuropower » Tue Mar 15, 2005 6:05 pm

Just a quick note. Addit's MOD works like a dream, but unfortunately it doesn't take take care of certain other HTML tags that are left in a post. For example, the MOD that converts spacebar characters (" ") into non-breaking spaces ("&nbsp;") appear as "&nbsp;" within the preview. That's the only bug I've found like this (and I'm sure that any other special characters may have similar issues)....but this one can be fixed by adding the following line...

$summary = preg_replace("/&nbsp;/iU",' ',$summary);

before this line in the MOD

$summary = htmlspecialchars(strip_tags($summary));

Hope that helps.

User avatar
Sound&Style
Registered User
Posts: 37
Joined: Sat Mar 19, 2005 9:10 pm

Post by Sound&Style » Sat Mar 19, 2005 9:17 pm

[message deleted by user]

Locked

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