Seite 2 von 2

Verfasst: 01.02.2006 21:03
von BZebra
BB-BF-BM hat geschrieben:Was glaubst du, weshalb ich hier Monologe führe? :wink:
Du führst doch keine Monologe, ich bin doch auch noch da! :wink:

Verfasst: 02.02.2006 15:48
von BB-BF-BM
nagut...
Wir sind schon auf der zweiten Seite...
Bald wird das >Thema als "Wichtig" erkannt :wink:

Re: Knowledge Base - Artikel-Namen verlinken

Verfasst: 02.02.2006 22:58
von BZebra
Schreiben wir noch mal die ursprüngliche Frage hin, damit sie auch auf dieser Seite steht:
BB-BF-BM hat geschrieben:Es gibt glaube ich eine MOD, mit dem man Forumsnamen verlinken kann, also dass wenn man drauflickt, man zu einer Seite ausserhalb des Forums weitergeleitet wird.
Gibt es so etwas auch für die Knowledge Base?
Ich möchte nämlich, dass wenn man auf den Artikel FAQ klickt, man zur Seite ./faq.php weitergeleitet wird. Ist das möglich?

Verfasst: 03.02.2006 15:27
von BB-BF-BM
Danke, gute Idee...
Oder andere Frage, könnte man die normale MOD Threadnamen verlinken umbauen?
Hätte aber keine ahnung, wie...

Verfasst: 03.02.2006 15:39
von BZebra
Wo ist dieser MOD eigentlich. Hatte ihn zwar vor ein paar Jahren mal eingebaut, finde ihn aber jetzt nicht mehr?

Verfasst: 03.02.2006 15:45
von BB-BF-BM
Suchen hilft...
Denke ich mal...

Verfasst: 03.02.2006 15:51
von BZebra
Da isser: Topic Title as Web Link by Oxpus

Keine Uploads außer ein Gif, keine Veränderungen an der Datenbank ... also, schauen wir mal was wir da hin bekommen.

Code: Alles auswählen

##############################################################
## MOD Title:		Topic Title as Weblink
## MOD Author: OXPUS < webmaster@oxpus.de > (Karsten Ude) http://www.oxpus.de
## MOD Description:	With this Mod admins and moderators can set a topic as a weblink
##			like sticky or announce.
##			If a topic is set as weblink, the post message will be used as URL.
##			The link can only be edit/delete from the moderator panel.
## MOD Version:		1.0.3
##
## Installation Level:	Intermediate
## Installation Time:	5-10 Minutes
## Files To Edit:	8
##			modcp.php
##			posting.php
##			search.php
##			viewforum.php
##			includes/constants.php
##			language/lang_english/lang_main.php
##			language/lang_german/lang_main.php
##			templates/subSilver/subSilver.cfg
##
## Included Files:	1
##			templates/subSilver/images/folder_weblink.gif
##############################################################
## 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:
##
## For various other mods you can find add-ons in the folder goodies.
##
##############################################################
## MOD History:
##
##   2005-11-02 - Version 1.0.3
##      - ADD Compliance to phpBB 2.0.18
##
##   2004-07-23 - Version 1.0.2
##      - Fix compatibility to topic calendar
##	  Fix one code-typo. 
##	  For update replace every POST_WEBLINK with POST_TITLE_LINK at all code changes
##	  this mod related (not the whole scripts!!!) and look into the update folder!
##	  If you also have installed an add-on, replace POST_WEBLINK on these code positions, too!
##
##   2004-06-02 - Version 1.0.1
##      - Fix heavy load on viewforum
##	  For update reinstall the part for viewtopic.php
##
##   2004-05-26 - Version 1.0.0
##      - First release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

# 
#-----[ COPY ]-------------------------------------------------- 
# 
copy templates/subSilver/images/folder_weblink.gif to templates/subSilver/images/folder_weblink.gif

# 
#-----[ OPEN ]-------------------------------------------------- 
# 
modcp.php

# 
#-----[ FIND ]-------------------------------------------------- 
# 
				else if ( $row['topic_type'] == POST_STICKY )
				{
					$folder_img = $images['folder_sticky'];
					$folder_alt = $lang['Topic_Sticky'];
				}

# 
#-----[ AFTER, ADD ]-------------------------------------------------- 
# 
				else if ( $row['topic_type'] == POST_TITLE_LINK )
				{
					$folder_img = $images['folder_weblink'];
					$folder_alt = $lang['Topic_Weblink'];
				}

# 
#-----[ FIND ]-------------------------------------------------- 
# 
			else if ( $topic_type == POST_STICKY )
			{
				$topic_type = $lang['Topic_Sticky'] . ' ';
			}

# 
#-----[ AFTER, ADD ]-------------------------------------------------- 
# 
			else if ( $topic_type == POST_TITLE_LINK )
			{
				$topic_type = $lang['Topic_Weblink'] . ' ';
			}

# 
#-----[ OPEN ]-------------------------------------------------- 
# 
posting.php

# 
#-----[ FIND ]------------------------------------------------ 
# 
$topic_type = ( in_array($topic_type, array(POST_NORMAL, POST_STICKY, POST_ANNOUNCE)) ) ? $topic_type : POST_NORMAL;

# 
#-----[ IN-LINE FIND ]------------------------------------------------ 
# 
POST_ANNOUNCE

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------------ 
#
, POST_TITLE_LINK

# 
#-----[ FIND ]-------------------------------------------------- 
# 
		else if ( $topic_type == POST_STICKY )
		{
			$is_auth_type = 'auth_sticky';
		}

# 
#-----[ AFTER, ADD ]-------------------------------------------------- 
# 
		else if ( $topic_type == POST_TITLE_LINK )
		{
			$is_auth_type = 'auth_post';
		}

# 
#-----[ FIND ]-------------------------------------------------- 
# 
			prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length);

# 
#-----[ BEFORE, ADD ]-------------------------------------------------- 
# 
			if ( $topic_type == POST_TITLE_LINK )
			{
				$bbcode_on = 0;
				$html_on = 0;
				$smilies_on = 0;
			}

# 
#-----[ FIND ]-------------------------------------------------- 
# 
	if( $is_auth['auth_sticky'] )
	{
		$topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_STICKY . '"';
		if ( $post_data['topic_type'] == POST_STICKY || $topic_type == POST_STICKY )
		{
			$topic_type_toggle .= ' checked="checked"';
		}
		$topic_type_toggle .= ' /> ' . $lang['Post_Sticky'] . '&nbsp;&nbsp;';
	}

# 
#-----[ BEFORE, ADD ]-------------------------------------------------- 
# 
	if( ( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD ) && $is_auth['auth_post'] )
	{
		$topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_TITLE_LINK . '"';
		if ( $post_data['topic_type'] == POST_TITLE_LINK || $topic_type == POST_TITLE_LINK )
		{
			$topic_type_toggle .= ' checked="checked"';
		}
		$topic_type_toggle .= ' /> ' . $lang['Post_Weblink'] . '&nbsp;&nbsp;';
	}

# 
#-----[ OPEN ]------------------------------------------
#  
search.php

# 
#-----[ FIND ]---------------------------------------------------
#
			$sql = "SELECT t.*, f.forum_id, f.forum_name, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
				FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
				WHERE t.topic_id IN ($search_results)
					AND t.topic_poster = u.user_id
					AND f.forum_id = t.forum_id
					AND p.post_id = t.topic_first_post_id
					AND p2.post_id = t.topic_last_post_id
					AND u2.user_id = p2.poster_id";

# 
#-----[ IN-LINE FIND ]---------------------------------------------------
#
p2.post_time

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------------------------
#
, pt.post_text

# 
#-----[ IN-LINE FIND ]---------------------------------------------------
#
, " . USERS_TABLE . " u2
# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------------------------
#
, " . POSTS_TEXT_TABLE . " pt

# 
#-----[ IN-LINE FIND ]---------------------------------------------------
#
				WHERE t.topic_id IN ($search_results)

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------------------------
#
					AND pt.post_id = t.topic_first_post_id

# 
#-----[ FIND ]---------------------------------------------------
#
				$template->assign_block_vars("searchresults", array(
					'TOPIC_TITLE' => $topic_title,

# 
#-----[ BEFORE, ADD ]---------------------------------------------------
#
				if ( $searchset[$i]['topic_type'] == POST_TITLE_LINK )
				{
					$topic_url = $searchset[$i]['post_text'];
					$post_url = $topic_url;
					$message = '';
					$poster = '';
					$mini_post_img = '';
					$searchset[$i]['topic_replies'] = '';
					$searchset[$i]['topic_views'] = '';
					$message = '';
					$mini_post_alt = '';
				}

# 
#-----[ FIND ]---------------------------------------------------
#
				else if ($topic_type == POST_STICKY)
				{
					$topic_type = $lang['Topic_Sticky'] . ' ';
				}

# 
#-----[ AFTER, ADD ]---------------------------------------------------
#
				else if ($topic_type == POST_TITLE_LINK)
				{
					$topic_type = $lang['Topic_Weblink'] . ' ';
				}

# 
#-----[ FIND ]---------------------------------------------------
#
					else if ( $searchset[$i]['topic_type'] == POST_STICKY )
					{
						$folder = $images['folder_sticky'];
						$folder_new = $images['folder_sticky_new'];
					}

# 
#-----[ AFTER, ADD ]---------------------------------------------------
#
					else if ( $searchset[$i]['topic_type'] == POST_TITLE_LINK )
					{
						$folder = $images['folder_weblink'];
						$folder_new = $images['folder_weblink'];
					}

# 
#-----[ FIND ]---------------------------------------------------
#
				$template->assign_block_vars('searchresults', array(
					'FORUM_NAME' => get_object_lang(POST_FORUM_URL . $searchset[$i]['forum_id'], 'name'),

# 
#-----[ BEFORE, ADD ]---------------------------------------------------
#
				if ( $searchset[$i]['topic_type'] == POST_TITLE_LINK )
				{
					$topic_url = $searchset[$i]['post_text'];
					$newest_post_img = '';
					$replies = '';
					$views = '';
					$last_post_author = '';
					$last_post_url = '';
					$folder_alt = '';
				}

# 
#-----[ OPEN ]-------------------------------------------------- 
# 
viewforum.php

# 
#-----[ FIND ]-------------------------------------------------- 
# 
		else if( $topic_type == POST_STICKY )
		{
			$topic_type = $lang['Topic_Sticky'] . ' ';
		}

# 
#-----[ AFTER, ADD ]-------------------------------------------------- 
# 
		else if( $topic_type == POST_TITLE_LINK )
		{
			$topic_type = $lang['Topic_Weblink'] . ' ';
		}

# 
#-----[ FIND ]-------------------------------------------------- 
# 
			else if( $topic_rowset[$i]['topic_type'] == POST_STICKY )
			{
				$folder = $images['folder_sticky'];
				$folder_new = $images['folder_sticky_new'];
			}

# 
#-----[ AFTER, ADD ]-------------------------------------------------- 
# 
			else if( $topic_rowset[$i]['topic_type'] == POST_TITLE_LINK )
			{
				$folder = $images['folder_weblink'];
				$folder_new = $images['folder_weblink'];
			}

# 
#-----[ FIND ]-------------------------------------------------- 
# 
		$template->assign_block_vars('topicrow', array(
			'ROW_COLOR' => $row_color,
			'ROW_CLASS' => $row_class,

# 
#-----[ BEFORE, ADD ]-------------------------------------------------- 
# 
		$topic_edit = '';
		if ( $topic_rowset[$i]['topic_type'] == POST_TITLE_LINK )
		{
			$topic_edit = ( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD ) ? '&nbsp;&nbsp;&nbsp;<a href="'.$view_topic_url.'" class="nav"><img src="'.$images['icon_edit'].'" border="0" /></a>' : '';

			$sql = "SELECT post_text FROM " . POSTS_TEXT_TABLE . "
				WHERE post_id = ".$topic_rowset[$i]['topic_first_post_id'];
			if ( !$result = $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not create topic title weblink', '', __LINE__, __FILE__, $sql);
			}

			while ( $row = $db->sql_fetchrow($result) )
			{
				$view_topic_url = $row['post_text'];
			}

			$db->sql_freeresult($result);

			$last_post_url = '';
			$views = '';
			$replies = '';
			$last_post_author = '';
			$newest_post_img = '';
		}

# 
#-----[ FIND ]-------------------------------------------------- 
# 
			'TOPIC_TITLE' => $topic_title,

# 
#-----[ AFTER, ADD ]-------------------------------------------------- 
# 
			'TOPIC_EDIT' => $topic_edit,

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

# 
#-----[ FIND ]-------------------------------------------------- 
# 
define('POST_ANNOUNCE', 2);

# 
#-----[ AFTER, ADD ]-------------------------------------------------- 
# 
define('POST_TITLE_LINK', 99);

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

# 
#-----[ FIND ]-------------------------------------------------- 
# 
//
// Posting/Replying (Not private messaging!)
//

# 
#-----[ AFTER, ADD ]-------------------------------------------------- 
# 
$lang['Topic_link'] = 'Topic is weblink';
$lang['Topic_Weblink'] = 'Weblink';
$lang['Post_Weblink'] = 'Weblink';

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

# 
#-----[ FIND ]-------------------------------------------------- 
# 
//
// Posting/Replying (Not private messaging!)
//

# 
#-----[ AFTER, ADD ]-------------------------------------------------- 
# 
$lang['Topic_link'] = 'Topic ist Weblink';
$lang['Topic_Weblink'] = '<b>[Weblink]</b>';
$lang['Post_Weblink'] = 'Weblink';

# 
#-----[ OPEN ]-------------------------------------------------- 
# 
templates/subSilver/subSilver.cfg

# 
#-----[ FIND ]-------------------------------------------------- 
# 
$images['folder_poll_new'] = "$current_template_images/folder_poll_new.gif";

# 
#-----[ AFTER, ADD ]-------------------------------------------------- 
# 
$images['folder_weblink'] = "$current_template_images/folder_weblink.gif";

# 
#-----[ OPEN ]-------------------------------------------------- 
# 
templates/subSilver/viewforum_body.tpl

# 
#-----[ FIND ]-------------------------------------------------- 
# 
{row.topicrow.TOPIC_TITLE}&nbsp;</a>

# 
#-----[ IN-LINE AFTER, ADD ]-------------------------------------------------- 
# 
{row.topicrow.TOPIC_EDIT}


# 
#-----[ SAVE/CLOSE ALL FILES ]-------------------------------------------------- 
# 
# EoM
Also, modcp.php fällt weg, gibt keine Ordner-Images im KB-MOD.

posting.php und viewforum.php = kb.php

search.php = kb_search.php

Der Language-Teil ist erst mal Luxus.