Seite 1 von 1
Reihenfolge der Smilies im ACP bestimmen
Verfasst: 07.02.2005 19:35
von Fähnchen
Hall!
Ich habe vor längerer Zeit einmal einen Mod verwendet der es einem erlaubt im ACP die Reihenfolge der Smilies zu bestimmen.
Leider finde ich diesen Mod nicht wieder, weder auf phpbbhacks.com, noch auf phpbb.de und phpbb.com ist ja nicht erreichbar.
Kennt jemand von euch diesen Mod und weiss wo ich den herbekommen kann?
Googlen hat mir auch nicht weiter geholfen.

Verfasst: 07.02.2005 20:39
von Mario Siebert
Hier, den hatte ich noch auf der HDD, ich nehm an den meinst du?
########################################################
## MOD Title: Smilies Order
## MOD Author: LifeIsPain <brian@orvp.net> (Brian Evans)
## MOD Description: Allows for the smilies order to be changed
## MOD Version: 1.0.0
##
## Installation Level: easy
## Installation Time: 5 Minutes
##
## Files To Edit: 5
## - admin/admin_smilies.php
## - templates/subSilver/admin/smile_list_body.tpl
## - includes/functions_post.php
## - includes/constants.php
## - language/lang_english/lang_admin.php
##
## Included Files: None
########################################################
##
##
##############################################################
## 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/
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#
ALTER TABLE phpbb_smilies ADD smilies_order INT( 5 ) NOT NULL
#
#-----[ SQL ]------------------------------------------
#
INSERT INTO phpbb_config VALUES ('smilies_insert', 1)
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_smilies.php
#
#-----[ FIND ]------------------------------------------
#
for( $i = 0; $i < count($fcontents); $i++ )
#
#-----[ BEFORE, ADD ]------------------------------------------
#
if( $board_config['smilies_insert'] == TOP_LIST )
{
$sql = "SELECT MIN(smilies_order) AS smilies_extreme
FROM " . SMILIES_TABLE;
$shift_it = -10;
}
else
{
$sql = "SELECT MAX(smilies_order) AS smilies_extreme
FROM " . SMILIES_TABLE;
$shift_it = 10;
}
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get extreme values from the smilies table", "", __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$order_extreme = $row['smilies_extreme'] + $shift_it;
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . SMILIES_TABLE . " (code, smile_url, emoticon)
VALUES('" . str_replace("\'", "''", $smile_data[$j]) . "', '" . str_replace("\'", "''", $smile_data[0]) . "', '" . str_replace("\'", "''", $smile_data[1]) . "')";
#
#-----[ REPLACE WITH ]------------------------------------------
#
//$sql = "INSERT INTO " . SMILIES_TABLE . " (code, smile_url, emoticon)
// VALUES('" . str_replace("\'", "''", $smile_data[$j]) . "', '" . str_replace("\'", "''", $smile_data[0]) . "', '" . str_replace("\'", "''", $smile_data[1]) . "')";
$sql = "INSERT INTO " . SMILIES_TABLE . " (code, smile_url, emoticon, smilies_order)
VALUES('" . str_replace("\'", "''", $smile_data[$j]) . "', '" . str_replace("\'", "''", $smile_data[0]) . "', '" . str_replace("\'", "''", $smile_data[1]) . "', $order_extreme)";
$order_extreme = $order_extreme + $shift_it;
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT *
FROM " . SMILIES_TABLE;
#
#-----[ REPLACE WITH ]------------------------------------------
#
$sql = "SELECT *
FROM " . SMILIES_TABLE ."
ORDER BY smilies_order";
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . SMILIES_TABLE . " (code, smile_url, emoticon)
VALUES ('" . str_replace("\'", "''", $smile_code) . "', '" . str_replace("\'", "''", $smile_url) . "', '" . str_replace("\'", "''", $smile_emotion) . "')";
#
#-----[ REPLACE WITH ]------------------------------------------
#
if( $board_config['smilies_insert'] == TOP_LIST )
{
$sql = "SELECT MIN(smilies_order) AS smilies_extreme
FROM " . SMILIES_TABLE;
$shift_it = -10;
}
else
{
$sql = "SELECT MAX(smilies_order) AS smilies_extreme
FROM " . SMILIES_TABLE;
$shift_it = 10;
}
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get extreme values from the smilies table", "", __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$order_extreme = $row['smilies_extreme'] + $shift_it;
//$sql = "INSERT INTO " . SMILIES_TABLE . " (code, smile_url, emoticon)
// VALUES ('" . str_replace("\'", "''", $smile_code) . "', '" . str_replace("\'", "''", $smile_url) . "', '" . str_replace("\'", "''", $smile_emotion) . "')";
$sql = "INSERT INTO " . SMILIES_TABLE . " (code, smile_url, emoticon, smilies_order)
VALUES ('" . str_replace("\'", "''", $smile_code) . "', '" . str_replace("\'", "''", $smile_url) . "', '" . str_replace("\'", "''", $smile_emotion) . "', $order_extreme)";
#
#-----[ FIND ]------------------------------------------
#
//
// This is the main display of the page before the admin has selected
// any options.
//
$sql = "SELECT *
FROM " . SMILIES_TABLE;
#
#-----[ REPLACE WITH ]------------------------------------------
#
if( $HTTP_GET_VARS['option'] == 'select' && isset($HTTP_POST_VARS['insert_position']) )
{
$sql = "UPDATE " . CONFIG_TABLE . " SET
config_value = '" . $HTTP_POST_VARS['insert_position'] . "'
WHERE config_name = 'smilies_insert'";
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Failed to update general configuration for smilies_insert", "", __LINE__, __FILE__, $sql);
}
$board_config['smilies_insert'] = $HTTP_POST_VARS['insert_position'];
}
if( $board_config['smilies_insert'] == TOP_LIST )
{
$pos_top_checked = ' selected="selected"';
$pos_bot_checked = '';
}
else
{
$pos_top_checked = '';
$pos_bot_checked = ' selected="selected"';
}
$position_select = '<select name="insert_position"><option value="' . TOP_LIST . '"' . $pos_top_checked . '>' . $lang['before'] . '</option><option value="' . BOTTOM_LIST . '"' . $pos_bot_checked . '>' . $lang['after'] . '</option></select>';
if( isset($HTTP_GET_VARS['move']) && isset($HTTP_GET_VARS['id']) )
{
$moveit = ($HTTP_GET_VARS['move'] == 'up') ? -15 : 15;
$sql = "UPDATE " . SMILIES_TABLE . "
SET smilies_order = smilies_order + $moveit
WHERE smilies_id = " . $HTTP_GET_VARS['id'];
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't change smilies order", "", __LINE__, __FILE__, $sql);
}
$i = 10;
$inc = 10;
$sql = "SELECT *
FROM " . SMILIES_TABLE . "
ORDER BY smilies_order";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't query smilies order", "", __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
if ($row['smilies_order'] != $i)
{
$sql = "UPDATE " . SMILIES_TABLE . "
SET smilies_order = $i
WHERE smilies_id = " . $row['smilies_id'];
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't update order fields", "", __LINE__, __FILE__, $sql);
}
}
$i += $inc;
}
}
//
// This is the main display of the page before the admin has selected
// any options.
//
$sql = "SELECT *
FROM " . SMILIES_TABLE . "
ORDER BY smilies_order";
#
#-----[ FIND ]------------------------------------------
#
"L_EXPORT_PACK" => $lang['export_smile_pack'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_MOVE' => $lang['Move'],
'L_MOVE_UP' => $lang['Move_up'],
'L_MOVE_DOWN' => $lang['Move_down'],
'L_POSITION_NEW_SMILIES' => $lang['position_new_smilies'],
'L_SMILEY_CHANGE_POSITION' => $lang['smiley_change_position'],
'L_SMILEY_CONFIG' => $lang['smiley_config'],
'POSITION_SELECT' => $position_select,
'S_POSITION_ACTION' => append_sid('admin_smilies.' . $phpEx . '?option=select'),
#
#-----[ FIND ]------------------------------------------
#
"U_SMILEY_EDIT" => append_sid("admin_smilies.$phpEx?mode=edit&id=" . $smilies[$i]['smilies_id']),
#
#-----[ BEFORE, ADD ]------------------------------------------
#
'U_SMILEY_MOVE_UP' => append_sid("admin_smilies.$phpEx?move=up&id=" . $smilies[$i]['smilies_id']),
'U_SMILEY_MOVE_DOWN' => append_sid("admin_smilies.$phpEx?move=down&id=" . $smilies[$i]['smilies_id']),
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/smile_list_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<th class="thTop">{L_EMOT}</th>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<th class="thTop">{L_MOVE}</th>
#
#-----[ FIND ]------------------------------------------
#
<td class="{smiles.ROW_CLASS}">{smiles.EMOT}</td>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<td class="{smiles.ROW_CLASS}"><div class="gensmall" align="center"><a href="{smiles.U_SMILEY_MOVE_UP}">{L_MOVE_UP}</a><br /><a href="{smiles.U_SMILEY_MOVE_DOWN}">{L_MOVE_DOWN}</a></div></td>
#
#-----[ FIND ]------------------------------------------
#
<td class="catBottom" colspan="5" align="center">{S_HIDDEN_FIELDS}<input type="submit" name="add" value="{L_SMILEY_ADD}" class="mainoption" /> <input class="liteoption" type="submit" name="import_pack" value="{L_IMPORT_PACK}"> <input class="liteoption" type="submit" name="export_pack" value="{L_EXPORT_PACK}"></td>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
5
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
6
#
#-----[ FIND ]------------------------------------------
#
</table></form>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<form method="post" action="{S_POSITION_ACTION}"><table cellspacing="1" cellpadding="4" border="0" align="center" class="forumline">
<tr><th class="thTop" colspan="2">{L_SMILEY_CONFIG}</th></tr>
<tr><td class="row1">{L_POSITION_NEW_SMILIES}</td><td class="row2">{POSITION_SELECT}</td></tr>
<tr><td class="catBottom" align="center" colspan="2">{S_HIDDEN_FIELDS}<input type="submit" name="change" value="{L_SMILEY_CHANGE_POSITION}" class="mainoption" /></td></tr>
</table></form>
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]------------------------------------------
#
ORDER BY smilies_id";
#
#-----[ REPLACE WITH ]------------------------------------------
#
ORDER BY smilies_order";
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Click_return_smileadmin']
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['position_new_smilies'] = 'Should new smilies be added before or after existing smilies?';
$lang['smiley_change_position'] = 'Change Insert Location';
$lang['before'] = 'Before';
$lang['after'] = 'After';
#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]------------------------------------------
#
// Debug Level
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Smilies Order
define('TOP_LIST', -1);
define('BOTTOM_LIST', 1);
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Grüße Mario
Verfasst: 07.02.2005 23:18
von Mehrpack
hi,
da fehlen aber noch die 4 gifs die mit im packet dabei sind.
Mehrpack
Verfasst: 08.02.2005 01:19
von horscht
wenn phpbb.com erreichbar wäre, dann könntest du den Mod
hier downloaden.
aber da das aus aktuellem Anlass nicht der Fall ist bekommst du nun die Bilder
arrow_down.gif: [ externes Bild ]
arrow_up.gif: [ externes Bild ]
arrow_end.gif: [ externes Bild ]
arrow_top.gif: [ externes Bild ]
Verfasst: 08.02.2005 01:29
von Fähnchen
Wow!
Herzlichen Dank für die Mühe!
Genau den habe ich gesucht.