Jump to content

Recommended Posts

alright, so I found a phpBB hack that works, now I need a little help tweaking it.

everything in the script worked fine, but I want it to also display all the things it displays in the forum

(author, views, replies) so i went into the files and they had what I thought were variable, and they looked like this:

{L_REPLIES} {L_AUTHOR} {L_VIEWS}

so i plugged those into my script and instead of displaying the information it displayed them as is,

so that did me no good. Can anyone tell me how to get those variable to work?

heres the script if it will help:

<? 
$urlPath = "/forum";	//example: if your forum URL looks like http://kocky-online.cz/forum, this should be "/forum"
$serverPath = "MY_PATH/forum/config.php";			//example: when this file is in URL path /forum/mod, this should be ../config.php
if(empty($count))
$count = "10";									//default value of how many posts/topics to show
if(empty($type))
$type = "posts";		//default value of whether to show 'posts' or 'topics' 
$titleLimit = 30;			//this is max.length of 'title' of topic/post
$moreLimit = 20;			//this is max.length of 'more' (used in posts)

//-----------------[ DO NOT EDIT BELOW HERE ]------------------------- 
include_once("$serverPath"); 
$db = @mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("here we die at connection"); 
@mysql_select_db("$dbname",$db) or die("here we die"); 

if($type == "posts") 
{
$prefix = 'p';
   $sql = "SELECT x.post_subject as title, p.post_id as id, f.forum_id, t.topic_title as more "
   		."FROM ${table_prefix}topics t, ${table_prefix}forums f, ${table_prefix}posts p, ${table_prefix}posts_text x "
   		."WHERE t.topic_id = p.topic_id AND f.forum_id = t.forum_id AND p.post_id = x.post_id "
   		."ORDER BY p.post_id DESC "
   		."LIMIT $count"; 
}
else 
{
$prefix = 't';
   $sql = "SELECT t.topic_title as title, t.topic_id as id, f.forum_id, '' as more "
   		."FROM ${table_prefix}topics t, ${table_prefix}forums f "
   		."WHERE f.forum_id = t.forum_id "
   		."ORDER BY topic_time DESC "
   		."LIMIT $count"; 
}

//echo $sql;

if($r = mysql_query($sql, $db)) { 
while($m = mysql_fetch_array($r)) { 
	$j = stripslashes($m[title]); 
	$k = substr($j, 0, $titleLimit) . "..."; 
	if(!empty($m[more]))
		$m[more] = '('.substr($m[more], 0, $moreLimit) . '...)'; 
	if ($type == 'posts') {
		$anchor = '#'.$m[id];
	}
	//-------------------[ THIS IS ONLY LINE YOU COULD CHANGE ]--------------------------
	echo "<a title=\"$m[title]\" href=\"$urlPath/viewtopic.php?${prefix}=$m[id]&sid=$m[forum_id]${anchor}\">$k</a> $m[more]<br>"; 
} 
} 
;
//-------------------[ DO NOT EDIT UP HERE ]--------------------------
?>

Link to comment
https://forums.phpfreaks.com/topic/57823-new-posts-part-2-lol-phpbb/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.