phpBB NEWS

Du suchst einen bestimmten Mod, weißt aber nicht genau wo bzw. ob er überhaupt existiert? Wenn dir dieser Artikel nicht weiterhilft, kannst du hier den von dir gewünschten/gesuchten Mod beschreiben ...
Falls ein Mod-Autor eine der Anfragen hier aufnimmt um einen neuen Mod zu entwicklen, geht's in phpBB 2.0: Mods in Entwicklung weiter.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
_MS_
Mitglied
Beiträge: 3
Registriert: 11.09.2004 19:30

phpBB NEWS

Beitrag von _MS_ »

Hallo liebe phpBBler...
ich habe nun schon mehrfach gesucht, habe aber nicht wirklich das gefunden was ich suche, vielleicht könnt ihr mir ja helfen:

Also, ich suche ein MOD bzw. Script mit dem ich ein (bestimmtes?) Topic eroffnen kann, was dann auch als News auf meiner Homepage angezeigt werden kann, nur halt als normaler Text aus dem Topic mit Link drunter (z.B. "comments"), der dann auf den Thread im Forum verweist...
schlubiz
Mitglied
Beiträge: 103
Registriert: 28.07.2004 12:13
Kontaktdaten:

Beitrag von schlubiz »

hab ich auch seeeehr lange nach gesucht und dann (glücklicherweise) gefunden :D
ist seit paar monaten auch erfolgreich bei mir im einsatz (news, termine, spielberichte etc.) :)
daher nachfolgend das script für alle suchenden ;) (leider gibts m-i-x.net und das zugehörige support-forum nich mehr)

Code: Alles auswählen

##############################################################
## MOD Title: Topic Extraction (MTE)
## MOD Author: mix1 < liamdawe@gmail.com > (Liam Dawe) http://www.m-i-x.net
## MOD Description: This mod will enable you to grab posts from any forum and display them on your website. Useful for news, articles, shoutbox, latest topic links etc.
## MOD Version: 1.4.2
##
## Installation Level: Easy
## Installation Time: 2-5 Minutes
## Files To Edit: topic.php
## Included Files: topic.php
##
############################################################## 
## Before Use
#############
If you use this mod/like this mod please link back to my site at http://www.m-i-x.net

And please do not claim this to be your own work!

###############
## Instructions
###############
This mod will enable you to display topics from a forum on your website. Useful for displaying news, articles, recent topics etc

You will first need to open up topic.php, here is what you can use;

// Things you can change at the top

$forum - whatever forum(s) you want topics from

$date_time - for this use either short or long (names are obvious)

$topic_link - use either topic or phpbb (topic will make the link send you to a page with just the topic and phpbb will send you to the actual phpbb topic on your forum)

$comment - comment link (topic when clicked will send them to the topic and reply will send them to a direct reply box)

$phpbb_root_path - where your phpbb is located

// To edit the look and feel

To edit what it looks like find lines 129, 136 and 151 these are where you can edit the look and feel.

Line 129 is if you are just using it to display a link.

Line 136 is the start of what it looks like when you click a link from line 129.

Line 151 is what it looks like showing all posts e.g. news listing.

// Including the page

The defualt display for including is showing the full topics to change go to line 14 and edit $show

$show = ''; - To display topic links
$show = 'full'; - Display the full topics

#####################
## Things you can use
#####################
These are all things you can use for displaying the posts.
Things that you shouldn't need are not shown here.
You should use them like this (Unless you have your own way) for example - {$echo_topic['topic_title']}.

$echo_topic - Using this can give you;
topic_title (would probably be needed if using for news)
topic_views (added extras?)
topic_replies (can be used for comments)


$echo_post - Using this can give you;
topic_id (articles/news number, also used for comments link) 
forum_id (to show what forum its in?)
post_time (could be needed for news)

$echo_text - Using this can give you;
post_subject 
post_text (to show the news or article)

$echo_user - Using this can give you;
username (news/articles poster)
user_sig
(these below could be used as general author info for news/articles?)
user_email
user_aim	
user_yim	
user_msnm

Comments link;
{$comment_link}

Topic link;
{$topic_link}
und hier die vorlage für die php-datei, welche du dann includen musst:

Code: Alles auswählen

<?php
## Mod Title: Topic Extraction (MTE)
## Version: 1.4.2

#############
## Edit Below
#############
// Where to take the topics from
// Always a number
$forum = '4';

// How to show the topics
// full or blank ('')
$show = 'full';

// How to display the date and time if used
// short or long
$date_time = 'short';

// How top display the topic link if usede
// topic or phpbb
$topic_link = 'topic';

// Comments link - how to send them to comments
// topic or reply
$comment = 'topic';

// Path to your forums directory
// Usually ./forum/ or ./phpBB/ or ./forums/
$phpbb_root_path = './forum/';

#############################################
## No Editing unless you know what your doing
#############################################
if ( !defined('IN_PHPBB') ) 
{
  define('IN_PHPBB', true);
  include($phpbb_root_path  . 'extension.inc');
  include($phpbb_root_path  . 'common.'.$phpEx);
  include($phpbb_root_path  . 'config.'.$phpEx);
}

if ($show == '' || $show == 'full')
{
	// Select the topic information from the correct forum and set it to $grab_topics
	$grab_topics = $db->sql_query("select * from {$table_prefix}topics where forum_id = '{$forum}' order by topic_id desc limit 1");
}

else if ($show == 'topic')
{
	$grab_topics = $db->sql_query("select * from {$table_prefix}topics where forum_id = '{$forum}' and topic_id = '{$_GET['t']}' order by topic_id desc limit 1");
}
	
// Grab the information using an array and set it to $echo_topic
while ($echo_topic = $db->sql_fetchrow($grab_topics))
{
	// Select the post information from the correct forum and set it to $grab_posts
	$grab_posts = $db->sql_query("select * from {$table_prefix}posts where forum_id = '{$forum}' and topic_id = '{$echo_topic['topic_id']}' limit 1");
	
	// Grab the information using an array and set it to $echo_post
	while ($echo_post = $db->sql_fetchrow($grab_posts))
	{
		// Now get the post_text using the post_id were looking at and sort it info $grab_posts_text
		$grab_posts_text = $db->sql_query("select * from {$table_prefix}posts_text where post_id = '{$echo_post['post_id']}'");
		
		// Grab the information using an array and set it to $echo_text
		while($echo_text = $db->sql_fetchrow($grab_posts_text))
		{
			// Find the user the posted
			$find_user = $db->sql_query("select * from {$table_prefix}users where user_id = '{$echo_post['poster_id']}'");
			
			// Sort this users info into array for the post
			while ($echo_user = $db->sql_fetchrow($find_user))
			{
					
				// Get rid of all those annoying characters from bbcode
				$echo_text = preg_replace('/\:[0-9a-z\:]+\]/si', ']', $echo_text);	
				
				// BBCode
				$echo_text = str_replace("[b]","<strong>",$echo_text);
				$echo_text = str_replace("[/b]","</strong>",$echo_text);
					
				$echo_text = str_replace("[i]","<em>",$echo_text);
				$echo_text = str_replace("[/i]","</em>",$echo_text);
					
				$echo_text = str_replace("[u]","<u>",$echo_text);
				$echo_text = str_replace("[/u]","</u>",$echo_text);
					
				$echo_text = preg_replace('/\[quote=(.*)\](.*)\[\/quote\]/Usi','<div style=\"padding: 7px\">$2</div>',$echo_text);
				
				$echo_text = str_replace("[quote]","<strong>Quote</strong><em>",$echo_text);
				$echo_text = str_replace("[/quote]","</em>",$echo_text);
					
				$echo_text = str_replace("[code]","<strong>Code</strong><em>",$echo_text);
				$echo_text = str_replace("
","</em>",$echo_text);

$echo_text = preg_replace('/\[list\](.*)\[\/list\]/si',"<div style=\"padding: 7px\">$1</div>",$echo_text);
$echo_text = preg_replace('/\
schlubiz
Mitglied
Beiträge: 103
Registriert: 28.07.2004 12:13
Kontaktdaten:

Beitrag von schlubiz »

ach so, problem gibts da nur, wenn das forum (z.b. für ein backup) gesperrt wird, da gibts dann in den seiten mit den includes ne häßliche fehlermeldung ;)

wenn man diesen mod einbaut, hat sich auch dieses probleme erledigt (getestet und für gut befunden :D )
_MS_
Mitglied
Beiträge: 3
Registriert: 11.09.2004 19:30

Beitrag von _MS_ »

thx thx thx für die schnelle antwort!!!
schlubiz
Mitglied
Beiträge: 103
Registriert: 28.07.2004 12:13
Kontaktdaten:

Beitrag von schlubiz »

kein problem :)

noch nen kleiner tipp:
wenn du z.b. nachfolgenden code mit einbaust, werden links in einem neuen fenster geöffnet, wenn du anstatt [url] nun [url2] benutzt (öffnen sich sonst im selben browser-fenster):

Code: Alles auswählen

$echo_text = preg_replace('/\[url2\](.*)\[\/url\]/Usi','<a href="$1" target="_blanc">$1</a>',$echo_text);
$echo_text = preg_replace('/\[url2=(.*)\](.*)\[\/url\]/Usi','<a href="$1" target="_blanc">$2</a>',$echo_text);
wird allerdings im forum nich richtig dargestellt (is ja klar, da es [url2] eigentlich ni gibt), in den seiten mit den includes isses allerdings korrekt...

greetz schlubiz
Antworten

Zurück zu „phpBB 2.0: Mod Suche/Anfragen“