Pagina 1 van 1

recent topics laten scrollen op de ezportal

Geplaatst: 22 apr 2005, 02:36
door Diddie
is dat deze mod?

Code: Selecteer alles

/***************************************************************************
 * Hack:     Scrolling Recent Topics With Links                    
 * Author:   Euphoria (xsdenied404@hotmail.com)
 ***************************************************************************
 * Description: This hack shows the last # topics on any page... Each topic
 *                   will link to it's post in the forum
 ***************************************************************************
 * Installation: You can write the whole code in a file (like index.php) or
 *               include this scroll.php wherever you want...
 *               <?php include("path/scroll.php");
  ***************************************************************************/

<?php
//
// Basic Configuration
// How Many Topics you want to display?
$topicnumber = 10;
// Scrolling towards up or down?
$scroll = "up";
// Change this to your phpBB path
$urlPath = "http://www.yourdomain.com/phpBB2/";

// Database Configuration (Where your phpBB config.php file is located
include 'phpBB2/config.php';

// Connecting & Selecting Databases
$table_topics = $table_prefix. "topics";
$table_forums = $table_prefix. "forums";
$table_posts = $table_prefix. "posts";
$table_users = $table_prefix. "users";
$link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("Could not connect");
mysql_select_db("$dbname") or die("Could not select database");

// Perform Sql Query
$query = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM $table_topics t, $table_forums f, $table_posts p, $table_users u
WHERE t.topic_id = p.topic_id AND 
f.forum_id = t.forum_id AND 
t.topic_status <> 2 AND 
p.post_id = t.topic_last_post_id AND 
p.poster_id = u.user_id
ORDER BY p.post_id DESC LIMIT $topicnumber";
$result = mysql_query($query) or die("Query failed");

// Outcome of the HTML
// Be carefull when you edit these!
print "<marquee id=\"recent_topics\" behavior=\"scroll\" direction=\"$scroll\" height=\"170\" scrolldelay=\"100\" scrollamount=\"2\" onMouseOver=\"document.all.recent_topics.stop()\" onMouseOut=\"document.all.recent_topics.start()\">
<table cellpadding='3' cellSpacing='2' width='350'>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo  "<tr valign='top'><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#FFCC00\"><b><a href=\"$urlPath/viewtopic.php?topic=$row[topic_id]&forum=$row[forum_id]\">" .
$row["topic_title"] .
"</a></td></font></b><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#C0C0C0\"> by: <a href=\"$urlPath/profile.php?mode=viewprofile&u=$row[user_id]\">" .
$row["username"] .
"</td><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#C0C0C0\">" .
date('F j, Y, g:i a', $row["post_time"]) .
"</td></tr></font>";
}
print "</table></marquee>";

// Free Result
mysql_free_result($result);

// Close the Connection
mysql_close($link);
?>
en wat moet ik hier eigenlijk mee doen?

Code: Selecteer alles

// Database Configuration (Where your phpBB config.php file is located
include 'phpBB2/config.php';
en dit:

Code: Selecteer alles

Perform Sql Query
geraak er niet echt uit :oops:

Geplaatst: 22 apr 2005, 08:42
door Stef
Nee, niet op ezPortal.
Die mod is gemaakt door Kooky.

Geplaatst: 22 apr 2005, 13:15
door Diddie
en waar kan ik die dan vinden? op phpBBHacks al niet denk ik en op mods.db9.dk ook niet.

Geplaatst: 22 apr 2005, 13:19
door Paul

Geplaatst: 22 apr 2005, 13:34
door Diddie
nope kdenkt het niet, dat is voor de recent links op ezportal.

Geplaatst: 22 apr 2005, 13:40
door Paul
deze dan:

Code: Selecteer alles

################################################################# 
## Titel: Recente onderwerpen blok voor Smartor's ezPortal
## Auteur: Smartor <smartor_xp@hotmail.com> - http://smartor.is-root.com
## Vertaling: Admiral Rob <robvanderburgt@home.nl>
## Beschrijving: Dit bestand legt uit hoe je het recente onderwerpen blok maakt op ezPortal
##
## Aan te passen bestanden: 3
##	portal.php
##	templates/subSilver/portal_body.tpl
##	language/lang_english/lang_main.php
##
## Bijgevoede bestanden: geen
##
################################################################# 

#
#-----[ OPEN ]-------------------------------------------------------
#
portal.php

#
#-----[ VIND: in configuratie sectie ]-------------------
#
// Poll bron forum ID: scheid met comma voor meerdere forums, bijv. '3,8,14'
$CFG['poll_forum'] = '1';

#
#-----[ AFTER ADD ]---------------------------------------
# Je zou ook moeten instellen
#
// Aantal recente OnderwerpenN (geen forum ID)
$CFG['number_recent_topics'] = '10';

// Bijzondere foprums voor Recente Onderwerpen, bijv. '2,4,10' (bericht: mijn recente onderwerpen script heeft zijn eigen permissie checking, zodat je deze variabel leeg kunt laten)
$CFG['exceptional_forums'] = '';

#
#-----[ VIND ]---------------------------------------------
#
else
{
	$l_total_user_s = $lang['Registered_users_total'];
}

#
#-----[ AFTER ADD ]---------------------------------------
#
//
// Recente onderwerpen
//
$sql = "SELECT * FROM ". FORUMS_TABLE . " ORDER BY forum_id";
if (!$result = $db->sql_query($sql))
{
	message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
	$forum_data[] = $row;
}

$is_auth_ary = array();
$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $forum_data);

if( $CFG['exceptional_forums'] == '' )
{
	$except_forum_id = '\'start\'';
}
else
{
	$except_forum_id = $CFG['exceptional_forums'];
}

for ($i = 0; $i < count($forum_data); $i++)
{
	if ((!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_read']) or (!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_view']))
	{
		if ($except_forum_id == '\'start\'')
		{
			$except_forum_id = $forum_data[$i]['forum_id'];
		}
		else
		{
			$except_forum_id .= ',' . $forum_data[$i]['forum_id'];
		}
	}
}
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
		FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u
		WHERE t.forum_id NOT IN (" . $except_forum_id . ")
			AND t.topic_status <> 2
			AND p.post_id = t.topic_last_post_id
			AND p.poster_id = u.user_id
		ORDER BY p.post_id DESC
		LIMIT " . $CFG['number_recent_topics'];
if (!$result = $db->sql_query($sql))
{
	message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql);
}
$number_recent_topics = $db->sql_numrows($result);
$recent_topic_row = array();
while ($row = $db->sql_fetchrow($result))
{
	$recent_topic_row[] = $row;
}
for ($i = 0; $i < $number_recent_topics; $i++)
{
	$template->assign_block_vars('recent_topic_row', array(
		'U_TITLE' => append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $recent_topic_row[$i]['post_id']) . '#' .$recent_topic_row[$i]['post_id'],
		'L_TITLE' => $recent_topic_row[$i]['topic_title'],
		'U_POSTER' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $recent_topic_row[$i]['user_id']),
		'S_POSTER' => $recent_topic_row[$i]['username'],
		'S_POSTTIME' => create_date($board_config['default_dateformat'], $recent_topic_row[$i]['post_time'], $board_config['board_timezone'])
		)
	);
}
//
// BEEINDIG - Recente onderwerpen
//

#
#-----[ VIND ]---------------------------------------------
#
	'L_VOTE_BUTTON' => $lang['Vote'],

#
#-----[ VOEG DAARNA TOE ]----------------------------------------
#
	// Recente Onderwerpen
	'L_RECENT_TOPICS' => $lang['Recent_topics'],


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

#
#-----[ VIND ]---------------------------------------------
#
$lang['No_poll'] = 'No poll at the moment';

#
#-----[ VOEG DAARNA TOE ]----------------------------------------
#
$lang['Recent_topics'] = 'Recent topics'; // Recent Topics


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

#
#-----[ VIND ]---------------------------------------------
#
$lang['No_poll'] = 'Momenteel geen poll';

#
#-----[ VOEG DAARNA TOE ]----------------------------------------
#
$lang['Recent_topics'] = 'Recente onderwerpen'; // Recente onderwerpen


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

#
#-----[ VIND ]---------------------------------------------
#
		  <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
		   <tr>
			<td class="catHead" height="25"><span class="genmed"><b>{L_STATISTICS}</b></span></td>
		   </tr>
		   <tr>
			<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS}<br />{NEWEST_USER}<br /><br/>{TOTAL_POSTS} {TOTAL_TOPICS}<br />&nbsp;</span></td>
		   </tr>
		  </table>
		  
		  <br />
#
# Scroll Versie
#
#-----[ VOEG DAARNA TOE ]----------------------------------------
#
		  <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
		   <tr>
			<td class="catHead" height="25"><span class="genmed"><b>{L_RECENT_TOPICS}</b></span></td>
		   </tr>
		   <tr>
			<td class="row1" align="left"><span class="gensmall">
			<marquee id="recent_topics" behavior="scroll" direction="up" height="200" scrolldelay="100" scrollamount="2">
			<!-- BEGIN recent_topic_row -->
			&raquo; <a href="{recent_topic_row.U_TITLE}" onMouseOver="document.all.recent_topics.stop()" onMouseOut="document.all.recent_topics.start()">{recent_topic_row.L_TITLE}</a><br />
			by <a href="{recent_topic_row.U_POSTER}" onMouseOver="document.all.recent_topics.stop()" onMouseOut="document.all.recent_topics.start()">{recent_topic_row.S_POSTER}</a> on {recent_topic_row.S_POSTTIME}<br /><br />
			<!-- END recent_topic_row -->
			</marquee>
			</span></td>
		   </tr>
		  </table>
		  
		  <br />

#
# Klassieke Version
#-----[ OF ]------------------
#
		  <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
		   <tr>
			<td class="catHead" height="25"><span class="genmed"><b>{L_RECENT_TOPICS}</b></span></td>
		   </tr>
		   <tr>
			<td class="row1" align="left"><span class="gensmall">
			<!-- BEGIN recent_topic_row -->
			&raquo; <a href="{recent_topic_row.U_TITLE}">{recent_topic_row.L_TITLE}</a><br />
			by <a href="{recent_topic_row.U_POSTER}">{recent_topic_row.S_POSTER}</a> on {recent_topic_row.S_POSTTIME}<br /><br />
			<!-- END recent_topic_row -->
			</span></td>
		   </tr>
		  </table>
		  
		  <br />
#
#-----[ SLA OP/UPLOAD ALLE BESTANDEN ]------------------------------------------ 
#
# EoF
(uit me ezportal download :))

Geplaatst: 22 apr 2005, 13:49
door Diddie
yep, kdenk wel dat die het is, ga het ff proberen :thumb:

Geplaatst: 22 apr 2005, 15:01
door Diddie
kben hier he, ik krijg deze foutmelding: Parse error: syntax error, unexpected T_ELSE in C:\xampp\htdocs\phpBB2\portal.php on line 175

en dat is deze code:

Code: Selecteer alles

      'S_POSTER' => $recent_topic_row[$i]['username'],
      'S_POSTTIME' => create_date($board_config['default_dateformat'], $recent_topic_row[$i]['post_time'], $board_config['board_timezone'])
      )
   );
}
//
// BEEINDIG - Recente onderwerpen
else
{
	$l_total_user_s = $lang['Registered_users_total'];
}

if( $userdata['session_logged_in'] )
{
	$sql = "SELECT COUNT(post_id) as total
			FROM " . POSTS_TABLE . "
			WHERE post_time >= " . $userdata['user_lastvisit'];
	$result = $db->sql_query($sql);
else is regel 175

Geplaatst: 22 apr 2005, 15:03
door Paul
je heb tde mod niet geod uitgevoerd, kijk nog maar eens goed ;)

Geplaatst: 22 apr 2005, 15:13
door Diddie
tis in orde, die else moest er vantussen en dit ook {

Geplaatst: 22 apr 2005, 15:25
door Paul
neej, je moet het onder die else zetten, en niet erboven ;)

Geplaatst: 22 apr 2005, 15:39
door Diddie
yep het werkt, maar als ik nu over een link ga stopt die boel niet met scrollen
nog es bedankt voor de snelle response

Geplaatst: 22 apr 2005, 15:42
door Paul
http://www.deiremonne.be/phpBB2/index.p ... 1ac3232b75
die zou ik ook is update :)

en geef is een link waar je hem hebt geinstalleerd? En welke browser gebruik je?

Geplaatst: 22 apr 2005, 15:45
door Diddie
ik ben aan een nieuw forum bezig, het draait op mijn pc met het programma xammp :P
ik gebruik firefoxx, maar met IE blijft het wel stilstaan, is dit op te lossen?

Geplaatst: 22 apr 2005, 15:48
door Paul
In firefox kan dat niet. Dat werkt alleen in IE :(