Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.20.00 - All Issues
Author Message
testy1
Involved
Involved


Joined: Apr 06, 2008
Posts: 484

PostPosted: Mon May 26, 2008 12:28 am Reply with quote

I have tryed to install this extrmemly simple mod, but somehow ive managed to bodge it up Sad

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 < Only registered users can see links on this board! Get registered or login! > (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 Very Happy


please note the; ">

Any ideas on this one.
 
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9456
Location: Arizona

PostPosted: Mon May 26, 2008 9:18 am Reply with quote

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! 
View user's profile Send private message Visit poster's website
testy1
PostPosted: Mon May 26, 2008 3:52 pm Reply with quote

ok i check it twice. but todays a new day so ui will re-check to be sure and post back.
 
testy1
PostPosted: Mon May 26, 2008 4:00 pm Reply with quote

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&amp;t=2&amp;start=0&amp;postdays=0&amp;postorder=asc&amp;highlight=" title="Smilies in title &lt;img src=" modules="" forums="" images="" smiles="" icon_biggrin.gif="" alt="Very Happy" border="0">"&gt;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 Very Happy


also i just tryed creating a new topic and use the following as the topic title
Code:


:):):)


and got this

Quote:

SmileSmile">SmileSmileSmile


lol
 
warren-the-ape
Worker
Worker


Joined: Nov 19, 2007
Posts: 196
Location: Netherlands

PostPosted: Tue May 27, 2008 1:57 am Reply with quote

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.
 
View user's profile Send private message
testy1
PostPosted: Tue May 27, 2008 5:47 am Reply with quote

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 Razz
 
testy1
PostPosted: Tue May 27, 2008 11:53 pm Reply with quote

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
PostPosted: Fri May 30, 2008 6:49 pm Reply with quote

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
PostPosted: Sun Jun 01, 2008 5:25 pm Reply with quote

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
PostPosted: Tue Jun 03, 2008 1:01 am Reply with quote

anyone got any ideas, this is sending loopy Sad
 
warren-the-ape
PostPosted: Tue Jun 03, 2008 1:17 am Reply with quote

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&amp;t=2&amp;start=0&amp;postdays=0&amp;postorder=asc&amp;highlight=" title="Smilies in title &lt;img src=" modules="" forums="" images="" smiles="" icon_biggrin.gif="" alt="Very Happy" border="0">"&gt;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; "&gt; 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
PostPosted: Tue Jun 03, 2008 1:23 am Reply with quote

nah definately not a theme issue it does it on a fresh install using the same theme as this site, fisubice i think.
 
testy1
PostPosted: Wed Jun 04, 2008 7:07 pm Reply with quote

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 Razz

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
PostPosted: Thu Jun 05, 2008 5:36 am Reply with quote

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
PostPosted: Thu Jun 05, 2008 6:49 am Reply with quote

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.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.20.00 - All Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©