|
Author |
Message |
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Mon Sep 30, 2002 6:26 pm (21 years, 6 months ago) |
|
Hey,
How do you get the smilies list (and everything else you've done to this forum!) in the bits at the top?
Thanks |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Mon Sep 30, 2002 6:30 pm (21 years, 6 months ago) |
|
Well everything else is going to be a little difficult to describe , but here is the code for the smilies list:
Code: | <?php
/**********************************************************************************
########################################################
## Mod Title: Display Smilies
## Author: Billy Sauls < nivisec@hotmail.com >
########################################################
**********************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
//$userdata = session_pagestart($user_ip, PAGE_INDEX - 2262002, $board_config['session_length']);
init_userprefs($userdata);
//
// End session management
//
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx);
$page_title = $lang['Smilies'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->assign_vars(array(
"L_IMAGE" => $lang['smiley_url'],
"L_CODE" => $lang['smiley_code'],
"CLASS_1" => $theme['td_class1'],
"CLASS_2" => $theme['td_class2'],
"PAGE_NAME" => $page_title)
);
$template->set_filenames(array(
"body" => "smilies_list.tpl")
);
//
// Obtain Smilies
//
$sql = "SELECT code, smile_url, emoticon FROM " . SMILIES_TABLE;
$result = $db->sql_query($sql)
or message_die(GENERAL_ERROR, "Couldn't retrieve Smilie data", "", __LINE__, __FILE__, $sql);
//
// Sort into 2-D array indexed by image
//
while( $smilie_data = $db->sql_fetchrow($result) ) {
$smilie_url_array[$smilie_data['smile_url']]['emoticon'] = $smilie_data['emoticon'];
$smilie_url_array[$smilie_data['smile_url']]['code'] = ( is_null($smilie_url_array[$smilie_data['smile_url']]['code']) ) ? $smilie_data['code'] : $smilie_url_array[$smilie_data['smile_url']]['code'] . " or " . $smilie_data['code'];
}
$db->sql_freeresult($result);
//
// Assign template block vars and live happily ever after
//
$count = 0;
while ( list($key) = each($smilie_url_array) ) {
$count++;
$template->assign_block_vars("smilies", array(
"URL" => '<img src="'. $board_config['smilies_path'] . '/' . $key . '" alt="' . $smilie_url_array[$key]['emoticon'] . '" border="0">',
"EMOTICON" => $smilie_url_array[$key]['emoticon'],
"START" => ( ($count % 2) ) ? "<tr>" : "",
"END" => ( !($count % 2) ) ? "</tr>" : "",
"CODE" => $smilie_url_array[$key]['code'])
);
}
$template->pparse("body");
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
|
It may need customizing for your needs though...
You'll also need to set the values for $lang['smiley_url'] and $lang['smiley_code'] in the language file. |
________________________________
|
|
|
|
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Tue Oct 01, 2002 3:36 pm (21 years, 6 months ago) |
|
Could you tell me the website you got that from as I am not very good with phpBB!
Thanks |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Oct 01, 2002 4:26 pm (21 years, 6 months ago) |
|
As far as I know it was from phpBB.com, but what difference does that make? |
________________________________
|
|
|
|
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Wed Oct 02, 2002 3:02 pm (21 years, 6 months ago) |
|
Just that I don't understand how to change the list at the top to get Smilies List there etc |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Wed Oct 02, 2002 3:44 pm (21 years, 6 months ago) |
|
Just edit overall_header.tpl. If you can't get your head around the HTML, open up the file in a WYSIWYG editor. |
________________________________
|
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.14348 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |