Author |
Message |
testy1
Involved


Joined: Apr 06, 2008
Posts: 484
|
Posted:
Mon May 26, 2008 12:28 am |
|
I have tryed to install this extrmemly simple mod, but somehow ive managed to bodge it up
can anyone see where this would cause a problem with the latest RN.
Here is the mod code
Code:
##############################################################
## MOD Title: Smilies in Topic Titles
## MOD Author: Suisse < chatwithbea@bluewin.ch > (Florian Segginger) http://www.techno-revelation.com
## MOD Description: Shows smilies in topic titles
## MOD Version: 1.1.1
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: viewforum.php, viewtopic.php, search.php
## Included Files: n/a
##############################################################
## Author Notes:
## If you want to disable certain smilies because they are too big or just plain ugly,
## you have to put
## $topic_title = str_replace("code for smiley","",$$topic_title);
## just before
## $topic_title = smilies_pass($topic_title);
## In viewforum.php
## You obviously have to change 'code for smiley' with the actual bbcode of the smiley
## Example:
## $topic_title = str_replace(":)","",$topic_title);
##############################################################
## MOD History:
##
## 2004-04-4 - Version 1.0.0
## - This is the first release
## 2004-04-14 - Version 1.1.1
## - I have been notified of the fact that the smilies don't show in the search and getdaily page.
## The hack is still as easy to install as before(Thank you, Juan Antonio Illescas!)
## 2004-04-15
## - I removed the unexisting page to modify (getdaily.php). I don't know where it came from.
## Apparently, search.php has changed from my version of phpbb, so I can't garantee you the
## hack will display smilies on the search page if your version is greater than 2.0.6
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
#
#-----[ AFTER, ADD ]------------------------------------
#
//Parse smilies to display topic title
$topic_title = smilies_pass($topic_title);
#
#-----[ OPEN ]------------------------------------------
#
viewforum.php
#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'common.'.$phpEx);
#
#-----[ AFTER, ADD ]------------------------------------
#
//Request the bbcode parsing php page, so we don't call an undefined function ;)
include_once('includes/bbcode.php');
#
#-----[ FIND ]------------------------------------------
#
$topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];
#
#-----[ AFTER, ADD ]------------------------------------
#
//Parse smilies to show the title
//This is where you would put the code to disable certain smilies
$topic_title = smilies_pass($topic_title);
#
#-----[ OPEN ]------------------------------------------
#
search.php
#
#-----[ FIND ]------------------------------------------
#
if ( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $searchset[$i]['topic_title']);
}
#
#-----[ AFTER, ADD ]------------------------------------
#
//Parse smilies to show the title
//This is where you would put the code to disable certain smilies
$topic_title = smilies_pass($topic_title);
#
#-----[ FIND ]------------------------------------------
#
if ($board_config['allow_smilies'] && $searchset[$i]['enable_smilies'])
{
$message = smilies_pass($message);
#
#-----[ AFTER, ADD ]------------------------------------
#
//Parse smilies to show the title
//This is where you would put the code to disable certain smilies
$topic_title = smilies_pass($topic_title);
$post_subject = smilies_pass($post_subject);
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
|
now if i post a new topic without a smilie everything works fine.but if i post a new topic with a smilie it still works fine (displays the smilie) but displays it like this
Quote: | ">Test Topic With Smilie |
please note the; ">
Any ideas on this one. |
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Mon May 26, 2008 9:18 am |
|
Well, there is nothing wrong with the instruction statements, so its in how you have applied them. Might want to post a link to the text file version of what you have modified so that we can see your actual edits. |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
testy1

|
Posted:
Mon May 26, 2008 3:52 pm |
|
ok i check it twice. but todays a new day so ui will re-check to be sure and post back. |
|
|
|
 |
testy1

|
Posted:
Mon May 26, 2008 4:00 pm |
|
Ok i checked it again and its spot on but i decided to check the source code for the topic title and it seems to be way off somewhere....
here is the source code....
Code:
<a class="maintitle" href="forums.html?amp;file=viewtopic&t=2&start=0&postdays=0&postorder=asc&highlight=" title="Smilies in title <img src=" modules="" forums="" images="" smiles="" icon_biggrin.gif="" alt="Very Happy" border="0">">Smilies in title <img src="modules/Forums/images/smiles/icon_biggrin.gif" alt="Very Happy" border="0"></a>
|
and this is what it is displaying
Quote: |
">Smilies in title Very
|
also i just tryed creating a new topic and use the following as the topic title
and got this
lol |
|
|
|
 |
warren-the-ape
Worker


Joined: Nov 19, 2007
Posts: 196
Location: Netherlands
|
Posted:
Tue May 27, 2008 1:57 am |
|
Looks like you included double characters or forgot to close tags somewhere in your edits.
I think Montego ment to post the parts of your edited source files;
Quote: | Files To Edit: viewforum.php, viewtopic.php, search.php |
I already spot some missing quotes "" in your html output so its possible you made a small mistake somewhere. |
|
|
|
 |
testy1

|
Posted:
Tue May 27, 2008 5:47 am |
|
oh yer sry lol
the code changes dont influence that part it's just referencing the pass smilie function
but first thing in the morning ill post the code up, ive heard about this new sleep thing....gonna try it out  |
|
|
|
 |
testy1

|
Posted:
Tue May 27, 2008 11:53 pm |
|
here are the 3 files
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
|
 |
testy1

|
Posted:
Fri May 30, 2008 6:49 pm |
|
I have tryed this on a fresh install of RN and it still does it.It seems to be related to the smilie function somehow. |
|
|
|
 |
testy1

|
Posted:
Sun Jun 01, 2008 5:25 pm |
|
ok, here is the specific pieces of code
viewtopic.php
Code:
//
// Output page header
//
$page_title = $lang['View_topic'] .' - ' . $topic_title;
include_once("includes/page_header.php");
//Parse smilies to display topic title
$topic_title = smilies_pass($topic_title);
//
// User authorisation levels output
//
|
viewforum.php
Code:
include_once($phpbb_root_path . 'common.'.$phpEx);
//Request the bbcode parsing php page, so we don't call an undefined function ;)
include_once('includes/bbcode.php');
//
// Start initial var setup
//
|
Code:
//
// Okay, lets dump out the page ...
//
if( $total_topics )
{
for($i = 0; $i < $total_topics; $i++)
{
$topic_id = $topic_rowset[$i]['topic_id'];
$topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];
//Parse smilies to show the title
//This is where you would put the code to disable certain smilies
$topic_title = smilies_pass($topic_title);
$replies = $topic_rowset[$i]['topic_replies'];
$topic_type = $topic_rowset[$i]['topic_type'];
if( $topic_type == POST_ANNOUNCE )
|
search.php
Code:
if ($board_config['allow_smilies'] && $searchset[$i]['enable_smilies'])
{
$message = smilies_pass($message);
//Parse smilies to show the title
//This is where you would put the code to disable certain smilies
$topic_title = smilies_pass($topic_title);
$post_subject = smilies_pass($post_subject);
}
$message = str_replace("\n", '<br />', $message);
}
|
Code:
if ( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $searchset[$i]['topic_title']);
}
//Parse smilies to show the title
//This is where you would put the code to disable certain smilies
$topic_title = smilies_pass($topic_title);
$topic_type = $searchset[$i]['topic_type'];
if ($topic_type == POST_ANNOUNCE)
|
|
|
|
|
 |
testy1

|
Posted:
Tue Jun 03, 2008 1:01 am |
|
anyone got any ideas, this is sending loopy  |
|
|
|
 |
warren-the-ape

|
Posted:
Tue Jun 03, 2008 1:17 am |
|
testy1 wrote: |
the code changes dont influence that part it's just referencing the pass smilie function |
Yep, I see. Didnt look at the changes in the mod.
The html output is just very strange, it looks like it partially includes the html of the image in the anchor as well;
Quote: | <a class="maintitle" href="forums.html?amp;file=viewtopic&t=2&start=0&postdays=0&postorder=asc&highlight=" title="Smilies in title <img src=" modules="" forums="" images="" smiles="" icon_biggrin.gif="" alt="Very Happy" border="0">">Smilies in title <img src="modules/Forums/images/smiles/icon_biggrin.gif" alt="Very Happy" border="0"></a> |
Perhaps its not stripping the image completely and it becomes messed up with the title link, that also explains those; "> at the beginning of your output title. Its probably just the end of the img tag.
I have no idea were to look though, are you sure its not a theme issue? |
|
|
|
 |
testy1

|
Posted:
Tue Jun 03, 2008 1:23 am |
|
nah definately not a theme issue it does it on a fresh install using the same theme as this site, fisubice i think. |
|
|
|
 |
testy1

|
Posted:
Wed Jun 04, 2008 7:07 pm |
|
testy1 wrote: | nah definately not a theme issue it does it on a fresh install using the same theme as this site, fisubice i think. |
i retract my previous statement
around line 32 of themes/fisubice/forums/viewforum_body.tpl
Code:
<td class="row1" width="100%">{topicrow.NEWEST_POST_IMG}<span class="topictitle">{topicrow.TOPIC_TYPE}</span><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle" title="{topicrow.TOPIC_TITLE}">{topicrow.TOPIC_TITLE}</a><span class="gensmall"><br />{topicrow.GOTO_PAGE}</span></td>
|
if i change this to
Code:
<td class="row1" width="100%">{topicrow.NEWEST_POST_IMG}<span class="topictitle">{topicrow.TOPIC_TYPE}</span><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a><span class="gensmall"><br />{topicrow.GOTO_PAGE}</span></td>
|
hint: i removed
Code:
title="{topicrow.TOPIC_TITLE}"
|
everything works as it should although i dont see why this is effecting it.???? |
|
|
|
 |
montego

|
Posted:
Thu Jun 05, 2008 5:36 am |
|
What I was struggling with was why it was working in the topic text and not within the topic header - using the same smilies that is. And now I think this explains it. The title attribute is going from having straight text to now having embedded double quotes and so the first double quote it comes too is closing out the title attribute. Therefore, that forum mod is not done correctly.
Quite frankly, the "fix" for this might not be worth the extra code. If you are happy with not having a title attribute on this, then I'd leave your edit in place. If you are not happy with that, I'll give you an example of what to do to change it. |
|
|
|
 |
testy1

|
Posted:
Thu Jun 05, 2008 6:49 am |
|
well if its not right i'd like to fix it i suppose.I would definately like it done properly.But i do see what your saying now. |
|
|
|
 |
|