Portal Random Poll
Verfasst: 02.05.2008 17:34
Ich habe sowas nirgends gefunden und hab jetzt einfach mal versucht, selber einen Mod draus zu machen, schaut's euch mal an und sagt mir, ob ma des so machen kann (also des kann ma auf jeden Fall, weil es funktioniert
) aber halt, ob es so von der Form etc. in Ordnung ist und ob man es evtl. noch optimieren könnte (bin nich so der Profi in PHP, kann nur das was ich schon hab, ein bisschen abändern, bis es funktioniert^^)
Ich habe leider auch keine Ahnung, wie man Mods hochladen kann, oder ähnliches, aber ich glaube, es wäre am besten, wenn ma das bei den Snippets hinzufügen würde, oder?

Ich habe leider auch keine Ahnung, wie man Mods hochladen kann, oder ähnliches, aber ich glaube, es wäre am besten, wenn ma das bei den Snippets hinzufügen würde, oder?
##############################################################
## MOD Title: Replace recent poll on Intro + Portal Mod with a random poll
## MOD Author: Demolition_FABI < http://www.htfs.de/kontakt.php > http://www.htfs.de/
## MOD Description: The recent poll on the portal.php is replaced with a random poll from the forum-IDs,
## you have selected in the ACP.
##
## MOD Version: 1.0.1
##
## Installation Level: Easy
## Installation Time: 1 Minute
## Files To Edit: 1
## portal_poll.php
##
## Included Files: n/a
##############################################################
## 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/
##############################################################
## MOD History:
##
## 2008-05-01 - Version 1.0.0
## - First release
## 2008-05-01 - Version 1.0.1
## - removed some useless things
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
portal_poll.php
#
#-----[ FIND ]------------------------------------------
#
$sql = 'SELECT
t.*,
vd.*
FROM
' . TOPICS_TABLE . ' AS t,
' . VOTE_DESC_TABLE . ' AS vd
WHERE
t.forum_id IN (' . $forum_sql . ') AND
t.topic_status <> 1 AND
t.topic_status <> 2 AND
t.topic_vote = 1 AND
t.topic_id = vd.topic_id
ORDER BY
t.topic_time DESC
LIMIT
0,1';
#
#-----[ REPLACE WITH ]------------------------------------------
#
$sql = 'SELECT
t.*,
vd.*
FROM
' . TOPICS_TABLE . ' AS t,
' . VOTE_DESC_TABLE . ' AS vd
WHERE
t.forum_id IN (' . $forum_sql . ') AND
t.topic_status <> 1 AND
t.topic_status <> 2 AND
t.topic_vote = 1 AND
t.topic_id = vd.topic_id
ORDER BY
RAND()
LIMIT
0,1';
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM