Pagina 1 van 1

hoe pas ik deze code aan ?

Geplaatst: 12 jun 2003, 13:44
door Cyber Junkie

Code: Selecteer alles

$s_email_topic = '<a href="' . append_sid("email_topic.$phpEx?$action") . '">' . $lang['Email_topic'] . '</a>';
Ik heb deze code nu in mijn ./viewtopic.php deze code werkt goed maar ik krijg nu een tekst link te zien. ik heb ook de Part slices button Mod en wil hem graag daar mee intregeren hoe doe ik dit?

In mijn /template/XXX/viewtopicbody.tpl

staat het volgende:

Code: Selecteer alles

				<td nowrap="nowrap<img src="templates/fisubsilver/images/lang_english/topic_email.gif" alt="Email this topic" width="24" height="25" border="0" title="Email this topic - only it isn't installed" />
nu werkt de e-mail funktie niet omdat ik volgens de e-mail Mod {S_EMAIL_TOPIC} moet gebruiken en dan krijg ik een tekst link in mijn slice Mod heeft iemand een idee of moet je meer info dan hoor ik het graag.

Je kunt mijn site bekijken op reumalevenslang.messageboard.nl mijn het thema waar mee ik nu test is subice.

Het gaat om deze 2 Mods

Geplaatst: 12 jun 2003, 14:02
door Cyber Junkie
Part slices button:

Code: Selecteer alles

OPEN templates/f1subsilver/viewtopicbody.tpl

FIND

<table width="100%" border="0" cellspacing="0" cellpadding="2"> 
<tr> 
<td class="maintitle" valign="top">& nbsp;<a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></td> 
<td class="gensmall" align="right" valign="bottom"><a href="{U_VIEW_NEWER_TOPIC}">{L_VIEW_NEXT_TOPIC}</a><br /> 
<a href="{U_VIEW_OLDER_TOPIC}">{L_VIEW_PREVIOUS_TOPIC}</a><br /> 
<strong>{S_WATCH_TOPIC}</strong></td> 
</tr> 
</table> 
<table width="100%" cellspacing="2" cellpadding="2" border="0"> 
<tr> 
<td nowrap="nowrap"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" title="{L_POST_NEW_TOPIC}" height="25" width="82" /></a><a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" alt="{L_POST_REPLY_TOPIC}" width="82" height="25" hspace="8" border="0" title="{L_POST_REPLY_TOPIC}" /></a></td> 
<td width="100%" class="nav"><a href="{U_INDEX}">{L_INDEX}</a> & <a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></td> 
<td valign="bottom" nowrap="nowrap" class="genmed">{PAGINATION}</td> 
</tr> 
</table>

REPLACE WITH

<table width="100%" border="0" cellspacing="2" cellpadding="2"> 
<tr> 
<td height="34" valign="top" class="nav"><a href="{U_VIEW_TOPIC}" class="maintitle">{TOPIC_TITLE}</a> 
<br /> 
{PAGINATION}</td> 
<td class="gensmall">& nbsp;</td> 
</tr> 
</table> 
<table width="100%" cellspacing="2" cellpadding="2" border="0"> 
<tr> 
<td nowrap="nowrap"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" title="{L_POST_NEW_TOPIC}" /></a><a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" alt="{L_POST_REPLY_TOPIC}" hspace="8" border="0" title="{L_POST_REPLY_TOPIC}" /></a></td> 
<td width="100%" class="nav"><a href="{U_INDEX}">{L_INDEX}</a> & <a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></td> 
<td valign="bottom" nowrap="nowrap"><table width="100%" border="0" cellspacing="0" cellpadding="0"> 
            <tr> 
                        <td><a href="{U_VIEW_OLDER_TOPIC}"><img src="templates/fisubsilver/images/lang_english/topic_previous.gif" alt="{L_VIEW_PREVIOUS_TOPIC}" title="{L_VIEW_PREVIOUS_TOPIC}" width="15" height="25" border="0" /></a></td> 
                        <td nowrap="nowrap"><img src="templates/fisubsilver/images/lang_english/topic_email.gif" alt="Email this topic" width="24" height="25" border="0" title="Email this topic - only it isn't installed" /><a href="{U_PRINT}" target="_blank"><img src="templates/fisubsilver/images/lang_english/topic_print.gif" width="24" height="25" border="0" alt="{L_PRINT}" title="{L_PRINT}" /></a>{S_WATCH_TOPIC_IMG}<a href="{U_PRIVATEMSGS}"><img src="{PRIVMSG_IMG}" border="0" alt="{PRIVATE_MESSAGE_INFO}" title="{PRIVATE_MESSAGE_INFO}" /></a></td> 
                        <td><a href="{U_VIEW_NEWER_TOPIC}"><img src="templates/fisubsilver/images/lang_english/topic_next.gif" alt="{L_VIEW_NEXT_TOPIC}" title="{L_VIEW_NEXT_TOPIC}" width="14" height="25" border="0" /></a></td> 
            </tr> 
</table></td> 
</tr> 
</table>

FIND

<table width="100%" cellspacing="2" cellpadding="2" border="0"> 
<tr> 
<td nowrap="nowrap"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" title="{L_POST_NEW_TOPIC}" height="25" width="82" /></a><a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" alt="{L_POST_REPLY_TOPIC}" width="82" height="25" hspace="8" border="0" title="{L_POST_REPLY_TOPIC}" /></a></td> 
<td width="100%" class="nav"><a href="{U_INDEX}">{L_INDEX}</a> & <a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></td> 
<td valign="top" nowrap="nowrap" class="genmed">{PAGINATION}</td> 
</tr> 
</table> 
<table width="100%" border="0" cellspacing="0" cellpadding="2"> 
<tr> 
<td class="nav" valign="top"><br /> 
<br /> 
{JUMPBOX}<br /> 
<br /> 
{S_TOPIC_ADMIN}</td> 
<td class="gensmall" align="right" valign="top"><strong>{S_WATCH_TOPIC}</strong><br /> 
<a href="{U_VIEW_NEWER_TOPIC}">{L_VIEW_NEXT_TOPIC}</a><br /> 
<a href="{U_VIEW_OLDER_TOPIC}">{L_VIEW_PREVIOUS_TOPIC}</a><br /> 
{S_AUTH_LIST}</td> 
</tr> 
</table>

REPLACE WITH

<table width="100%" cellspacing="2" cellpadding="2" border="0"> 
<tr> 
<td nowrap="nowrap"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" title="{L_POST_NEW_TOPIC}" /></a><a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" alt="{L_POST_REPLY_TOPIC}" hspace="8" border="0" title="{L_POST_REPLY_TOPIC}" /></a></td> 
<td width="100%" class="nav"><a href="{U_INDEX}">{L_INDEX}</a> & <a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></td> 
<td valign="top" nowrap="nowrap"><table width="100%" border="0" cellspacing="0" cellpadding="0"> 
            <tr> 
                        <td><a href="{U_VIEW_OLDER_TOPIC}"><img src="templates/fisubsilver/images/lang_english/topic_previous.gif" alt="{L_VIEW_PREVIOUS_TOPIC}" title="{L_VIEW_PREVIOUS_TOPIC}" width="15" height="25" border="0" /></a></td> 
                        <td nowrap="nowrap"><img src="templates/fisubsilver/images/lang_english/topic_email.gif" alt="Email this topic" width="24" height="25" border="0" title="Email this topic - only it isn't installed" /><a href="{U_PRINT}" target="_blank"><img src="templates/fisubsilver/images/lang_english/topic_print.gif" width="24" height="25" border="0" alt="{L_PRINT}" title="{L_PRINT}" /></a>{S_WATCH_TOPIC_IMG}<a href="{U_PRIVATEMSGS}"><img src="{PRIVMSG_IMG}" border="0" alt="{PRIVATE_MESSAGE_INFO}" title="{PRIVATE_MESSAGE_INFO}" /></a></td> 
                        <td><a href="{U_VIEW_NEWER_TOPIC}"><img src="templates/fisubsilver/images/lang_english/topic_next.gif" alt="{L_VIEW_NEXT_TOPIC}" title="{L_VIEW_NEXT_TOPIC}" width="14" height="25" border="0" /></a></td> 
            </tr> 
</table></td> 
</tr> 
</table> 
<table width="100%" border="0" cellspacing="2" cellpadding="2"> 
<tr> 
<td class="nav" valign="top">{PAGINATION}</td> 
<td class="gensmall" align="right" valign="top">{S_AUTH_LIST}<br /> 
{S_TOPIC_ADMIN}</td> 
</tr> 
</table>

OPEN /templates/your template.cfg

FIND

$images['pm_new_msg'] = ""; 
$images['pm_no_new_msg'] = "";

REPLACE WITH

$images['pm_new_msg'] = "$current_template_images/{LANG}/pm_new.gif\" width=\"24\" height=\"25"; 
$images['pm_no_new_msg'] = "$current_template_images/{LANG}/pm_no_new.gif\" width=\"24\" height=\"25";

FIND

$images['topic_watch'] = ""; 
$images['topic_un_watch'] = "";

REPLACE WITH

$images['topic_watch'] = "$current_template_images/{LANG}/topic_watch.gif\" width=\"24\" height=\"25"; 
$images['topic_un_watch'] = "$current_template_images/{LANG}/topic_unwatch.gif\" width=\"24\" height=\"25";

ONLY FOR PHPBB 2.04

OPEN viewtopic.php

FIND SOMETHING LIKE THIS

// 
// Topic watch information 
// 
$s_watching_topic = ''; 
if ( $can_watch_topic ) 
{ 
   if ( $is_watching_topic ) 
   { 
      $s_watching_topic = "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&unwatch=topic&start=$start&sid=" . $userdata['session_id'] . '">' . $lang['Stop_watching_topic'] . '</a>'; 
      $s_watching_topic_img = ( isset($images['topic_un_watch']) ) ? "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&unwatch=topic&start=$start&sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_un_watch'] . '" alt="' . $lang['Stop_watching_topic'] . '" title="' . $lang['Stop_watching_topic'] . '" border="0" /></a>' : ''; 
   } 
   else 
   { 
      $s_watching_topic = "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&watch=topic&start=$start&sid=" . $userdata['session_id'] . '">' . $lang['Start_watching_topic'] . '</a>'; 
      $s_watching_topic_img = ( isset($images['topic_watch']) ) ? "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&watch=topic&start=$start&sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_watch'] . '" alt="' . $lang['Start_watching_topic'] . '" title="' . $lang['Start_watching_topic'] . '" border="0" /></a>' : ''; 
   } 
}

REPLACE WITH THIS

// 
// Topic watch information 
// 
$s_watching_topic = ''; 
if ( $can_watch_topic ) 
{ 
   if ( $is_watching_topic ) 
   { 
      $s_watching_topic = "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&unwatch=topic&start=$start&sid=" . $userdata['session_id'] . '">' . $lang['Stop_watching_topic'] . '</a>'; 
      $s_watching_topic_img = ( isset($images['topic_un_watch']) ) ? "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&unwatch=topic&start=$start&sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_un_watch'] . '" alt="' . $lang['Stop_watching_topic'] . '" title="' . $lang['Stop_watching_topic'] . '" border="0" /></a>' : ''; 
   } 
   else 
   { 
      $s_watching_topic = "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&watch=topic&start=$start&sid=" . $userdata['session_id'] . '">' . $lang['Start_watching_topic'] . '</a>'; 
      $s_watching_topic_img = ( isset($images['topic_watch']) ) ? "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&watch=topic&start=$start&sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_watch'] . '" alt="' . $lang['Start_watching_topic'] . '" title="' . $lang['Start_watching_topic'] . '" border="0" /></a>' : ''; 
   } 
}

(yes it is the same twice but when you search in the original viewtopic you should read carefull and notice that it is different!!!)

FOR OLDER TEMPLATES

FIND IN viewtopicbody.tpl something familier

<table width="100%" cellspacing="2" cellpadding="2" border="0"> 
<tr> 
<td nowrap="nowrap"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" title="{L_POST_NEW_TOPIC}" height="25" width="82" /></a><a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" alt="{L_POST_REPLY_TOPIC}" width="82" height="25" hspace="8" border="0" title="{L_POST_REPLY_TOPIC}" /></a></td> 
<td width="100%" class="nav"><a href="{U_INDEX}">{L_INDEX}</a> & <a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></td> 
<td valign="top" nowrap="nowrap" class="genmed">{PAGINATION}</td> 
</tr> 
</table> 
<table width="100%" border="0" cellspacing="0" cellpadding="2"> 
<tr> 
<td class="nav" valign="top"><br /> 
<br /> 
{JUMPBOX}<br /> 
<br /> 
{S_TOPIC_ADMIN}</td> 
<td class="gensmall" align="right" valign="top"><strong>{S_WATCH_TOPIC}</strong><br /> 
<a href="{U_VIEW_NEWER_TOPIC}">{L_VIEW_NEXT_TOPIC}</a><br /> 
<a href="{U_VIEW_OLDER_TOPIC}">{L_VIEW_PREVIOUS_TOPIC}</a><br /> 
{S_AUTH_LIST}</td> 
</tr> 
</table>

REPLACE WITH

<table width="100%" border="0" cellspacing="0" cellpadding="0"> 
            <tr> 
                        <td><a href="{U_VIEW_OLDER_TOPIC}"><img src="templates/fisubsilver/images/lang_english/topic_previous.gif" alt="{L_VIEW_PREVIOUS_TOPIC}" title="{L_VIEW_PREVIOUS_TOPIC}" width="15" height="25" border="0" /></a></td> 
                        <td nowrap="nowrap">{S_WATCH_TOPIC_IMG}<a href="{U_PRIVATEMSGS}"><img src="{PRIVMSG_IMG}" border="0" alt="{PRIVATE_MESSAGE_INFO}" title="{PRIVATE_MESSAGE_INFO}" /></a></td> 
                        <td><a href="{U_VIEW_NEWER_TOPIC}"><img src="templates/fisubsilver/images/lang_english/topic_next.gif" alt="{L_VIEW_NEXT_TOPIC}" title="{L_VIEW_NEXT_TOPIC}" width="14" height="25" border="0" /></a></td> 
            </tr> 
</table>

Before the email topic and print topic works you should download them first and install!!!

UPLOAD ALL THE FILES AND THE IMAGES INCLUDED
it should work now!!!

Like i told this is a quick howto, dont shoot me for mistakes!!!
En de Email topic to friend Mod

Code: Selecteer alles

###############################################
##	Mod Title:		Email topic to friend
##	Mod Version:	0.2
##	Author:			Vincent Grouls (macology@gmx.net)
##	Description:	This MOD allows you to send a friend of yours a topic of the board that
##					you find interesting for him. It is also very handy in this way that you
##					can email other members with interesting topics, while they are offline
##					for a long time (like when they are one vacation).
##
##	This mod works for phpBB2 v2.0.3
## 
## 
##	Installation Level: Easy
##	Installation Time: 5 Minutes
##
##	Files To Edit: 2
##		viewtopic.php
##		includes/contants.php
##		language/lang_english/lang_main.php
##		templates/subSilver/viewtopic_body.tpl
##
##	Included Files: 4
##		db_update.php
##		email_topic_body.tpl
##		email_topic.php
##		email_topic.tpl
##
##	Author Notes:
##		If you have email topic to friend 0.1, simply replace the file "email_topic.php"
##		to fix the bug.
##
##	History
##		0.2:	Fixed a little bug, where the idrinkbox (another mod of me) function was
##				called from the php page.
##
###############################################
##	This MOD is released under the GPL License. 
##	Intellectual Property is retained by the MOD Author(s) listed above 
###############################################

#
#-----[ COPY ]--------------------------------------------
#
# (this file should go in the root directory of your forum.
# Run it before using the MOD, and delete it immediately after that)
#
db_update.php

#
#-----[ COPY ]--------------------------------------------
#
# (this file should go in your templates directory)
# ./templates/subSilver/
#
email_topic_body.tpl

#
#-----[ COPY ]--------------------------------------------
#
# (this file should go in the root directory of your forum)
#
email_topic.php

#
#-----[ COPY ]--------------------------------------------
#
# (this file should go in the email directory in your
# language directory)
# ./language/lang_english/email/
#
email_topic.tpl

#
#-----[ OPEN ]--------------------------------------------
#  
./viewtopic.php

#
#-----[ FIND ]--------------------------------------------
#
//
// If we've got a hightlight set pass it on to pagination, 
// I get annoyed when I lose my highlight after the first page.
//

#
#-----[ BEFORE, ADD ]-------------------------------------
#
//
// Add the email topic to friend
//
$s_email_topic = '';
if ( $userdata['session_logged_in'] )
{
	$action = ( isset($post_id) ) ? POST_POST_URL . "=$post_id" : POST_TOPIC_URL . "=$topic_id&start=$start";
	$s_email_topic = '<a href="' . append_sid("email_topic.$phpEx?$action") . '">' . $lang['Email_topic'] . '</a>';
}

#
#-----[ FIND ]--------------------------------------------
#
'S_WATCH_TOPIC' => $s_watching_topic,

#
#-----[ AFTER, ADD ]--------------------------------------
#
'S_EMAIL_TOPIC' => $s_email_topic,

#
#-----[ OPEN ]--------------------------------------------
#
./includes/constants.php

#
#-----[ FIND ]--------------------------------------------
#
define('TOPICS_TABLE', $table_prefix.'topics');

#
#-----[ AFTER, ADD ]--------------------------------------
#
define('TOPICS_EMAIL_TABLE', $table_prefix.'topics_email');

#
#-----[ OPEN ]--------------------------------------------
#
./language/lang_english/lang_main.php

#
#-----[ FIND ]--------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------

#
#-----[ BEFORE, ADD ]-------------------------------------
#
# (make sure to edit this file for every language)
#
//
// Email topic to friend
//
$lang['Email_topic'] = 'Email topic to a friend';
$lang['Email_topic_settings'] = 'Email topic information';
$lang['Friend_name'] = 'Friend\'s name';
$lang['Friend_email'] = 'Friend\'s email';
$lang['Email_max_exceeded'] = 'Sorry, but you have already sent 5 emails in the past 24 hours';
$lang['No_friend_specified'] = 'No friend\s name/email specified';

#
#-----[ OPEN ]--------------------------------------------
#
# (make sure to edit this file for every template)
#
./templates/subSilver/viewtopic_body.tpl

#
#-----[ FIND ]--------------------------------------------
#
{S_WATCH_TOPIC}

#
#-----[ AFTER, ADD ]--------------------------------------
#
<br />{S_EMAIL_TOPIC}

#
#-----[ SAVE & CLOSE ALL FILES ]--------------------------
#

Geplaatst: 15 jun 2003, 20:09
door Cyber Junkie
Is al opgelost bedankt hoor :thumb: