Page 1 of 2

[BETA] Support Announcement MOD [ Latest: 1.2.3 ]

Posted: Sun Jan 18, 2004 8:40 pm
by ycl6
MOD Request: http://phpbb.com/phpBB/viewtopic.php?t=165850

Code: Select all

######################################################## 
## MOD Title: Support Announcement MOD
## MOD Author: ycl6 < [email protected] > (Y.C. LIN) http://macphpbbmod.sourceforge.net/
## MOD Description: This mod allow admin to show support status and details on forum. Most useful for webmasters hosting support forums
## MOD Version:	1.2.3
## 
## Installation Level: Easy 
## Installation Time: 3 Minutes 
##
## Files To Edit: 4
##	language/lang_english/lang_admin.php
##	language/lang_english/lang_main.php
##	includes/page_header.php
##	templates/subSilver/overall_header.tpl
##
## Included Files: 3
##	root/images/support.gif
##	root/admin/admin_support.php
##	root/templates/subSilver/admin/admin_support.tpl
##
## License: http://opensource.org/licenses/gpl-license.php GNU Public License v2 
################################################################# 
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
############################################################## 
## Author Notes:
##	Tested on 2.0.17, however should work on all 2.0.x versions
##	MOD screenshots inclused in screenshots folder
##	Dutch translation provided by carloclaessen, phpBB (dutch translation.txt)
## 
############################################################## 
## MOD History: 
##
##   2004-01-18 - Version 1.0.0
##      - Initial Release
##
##   2004-01-23 - Version 1.1.0
##      - Dutch translation provided by carloclaessen
##	- Submit to phpBB MOD DB
##
##   2004-01-30 - Version 1.2.0
##      - Added Offline and Online Support Officers
##
##   2004-03-15 - Version 1.2.1
##      - phpBB 2.0.7 Compliance
##	- A few code changes & fix
##	- Submit to phpBB MOD DB again
##
##   2004-05-21 - Version 1.2.2
##      - phpBB 2.0.8 Compliance
##	- Slight changes in the MOD template recommended by phpBB Validation Team
##	- Change MOD version declaration from template into language varible
##
##   2005-08-14 - Version 1.2.3
##      - Re-submitted to MOD DB
##	- Tested on 2.0.17 and use the latest MOD template
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
:arrow: Support Announcement MOD 1.2.3

~Mac

Posted: Sun Jan 18, 2004 9:32 pm
by Rapid Dr3am
Got a demo? It sounds like something I need, but I'm confused as to what it will look like. :)

Posted: Sun Jan 18, 2004 9:38 pm
by ycl6
Hi Rapid Dr3am, :wink:

Code: Select all

############################################################## 
## Author Notes: 
##   Tested on 2.0.6, however should work on all 2.0.x versions 
##   MOD screenshots inclused in EXTRA folder 
## 
############################################################## 
~Mac

Posted: Mon Jan 19, 2004 4:35 am
by Tom_S
This Mod is the specific thing I needed. The best! Thank you so much. Easy to install and bug free! I installed it on my test forum in less than three minutes manually. Fantastic!!!
Thank you again Mac :D

Posted: Mon Jan 19, 2004 10:33 am
by ycl6
thanlks for your feedback Tom_S :D

~Mac

Posted: Tue Jan 20, 2004 2:52 am
by Tom_S
ycl6 wrote: thanlks for your feedback Tom_S :D

~Mac


You are very welcome. I installed it on my users forum today and it is perfect. I had to do a tiny bit of modifying because of the way I have my site but no problems and smooth install. I also made a differnt icon for it in case you or others may wish to use it with the mod. Image

Thanks again :D

Posted: Tue Jan 20, 2004 12:43 pm
by carloclaessen

Code: Select all

//
// Support Announcement MOD
//
$lang['Support_config_updated'] = 'Support instellingen zijn succesvol bijgewerkt';
$lang['Click_return_support_config'] = 'Klik %shier%s om terug te gaan naar het Support Admin Beheer';
$lang['Support_config'] = 'Support Mededeling Beheer';
$lang['Support_config_explain'] = 'De velden hieronder laten je je support gedeelte opzetten voor het online support gedeelte';
$lang['Support_settings'] = 'Support Mededeling Beheer';
$lang['Support_status'] = 'Support Status';
$lang['Support_status_explain'] = 'Dit geeft de status weer van het support';
$lang['Support_admin_name'] = 'Support Medewerker(s)';
$lang['Support_admin_name_explain'] = 'De namen van de personen die support geven, bevoorbeeld de beheerder of een moderator<BR>Je mag HTML gebuiken en maximaal 255 tekens';
$lang['Support_detail'] = 'Support Details';
$lang['Support_deatil_explain'] = 'Je mag HTML gebuiken en maximaal 255 tekens';
$lang['Support_onlinetext'] = '<b>Online</b> Support Tekst';
$lang['Support_onlinetext_explain'] = 'De tekst die zichtbaar is op het forum als de supporter online is';
$lang['Support_offlinetext'] = '<b>Offline</b> Support Tekst';
$lang['Support_offlinetext_explain'] = 'De tekst die zichtbaar is op het forum als de supporter offline is';
$lang['Support_onlinecontact'] = '<b>Online</b> Contact Details';
$lang['Support_onlinecontact_explain'] = 'De contact gegevens van de Persoon die je support kan geven';
$lang['Support_offlinecontact'] = '<b>Offline</b> Contact details';
$lang['Support_offlinecontact_explain'] = 'De contact gegevens van de Persoon die je support kan geven';
$lang['Support_image'] = 'Support Afbeelding Directorie';
$lang['Support_image_explain'] = 'Directorie in je phpBB installatie, bijvoorbeeld images/support.gif';

Code: Select all

//
// Support Announcement MOD
//
$lang['support_admin_name_n'] = 'Niet Aanwezig';
$lang['support_text_n'] = 'Niet Aanwezig';
$lang['support_contact_n'] = 'Niet Aanwezig';
$lang['support_image_n'] = 'Geen Ingesteld';
$lang['Support_status_f'] = 'Support Status';
$lang['Support_admin_name_f'] = 'Support Medewerker(s)';
$lang['Support_text_f'] = 'Details';
$lang['Support_contact_f'] = 'Hoe contact op te nemen';
$lang['On'] = 'Aan';
$lang['Off'] = 'Uit';
dutch translation

Posted: Tue Jan 20, 2004 1:01 pm
by ycl6
Thank you carloclaessen, I will add this to the MOD when I submit to the MOD DB. If anyone wanted to help in local translation please post the translated text in this topic.

Translation credit goes to the translators

I would submit this MOD on 23/01/04. Welcome any feedback or suggestions

~Mac

Posted: Fri Jan 23, 2004 1:37 pm
by ycl6
I have just submitted this MOD to db. Hope to have it released soon. :o

~Mac

Posted: Fri Jan 23, 2004 4:43 pm
by pokemaster
i can't seem to do the db_updates it says there is a error with :

it keeps saying there is a error on line 55

Code: Select all

<?php
/***************************************************************************
 *                               db_update.php
 *                            -------------------
 *
 *   copyright            : ©2003 Freakin' Booty ;-P & Antony Bailey
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

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);
init_userprefs($userdata);
//
// End session management
//


if( !$userdata['session_logged_in'] )
{
	$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
	header($header_location . append_sid("login.$phpEx?redirect=db_update.$phpEx", true));
	exit;
}

if( $userdata['user_level'] != ADMIN )
{
	message_die(GENERAL_MESSAGE, 'You are not authorised to access this page');
}


$page_title = 'Updating the database';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
echo '<tr><th>Updating the database</th></tr><tr><td><span class="genmed"><ul type="circle">';


$sql = array();
$sql[] = "INSERT INTO " . $table_prefix . "config VALUES ("support_status",'0')";
$sql[] = "INSERT INTO " . $table_prefix . "config VALUES ("support_admin_name",'')";
$sql[] = "INSERT INTO " . $table_prefix . "config VALUES ("support_onlinetext",'')";
$sql[] = "INSERT INTO " . $table_prefix . "config VALUES ("support_onlinecontact",'')";
$sql[] = "INSERT INTO " . $table_prefix . "config VALUES ("support_offlinetext",'')";
$sql[] = "INSERT INTO " . $table_prefix . "config VALUES ("support_offlinecontact",'')";
$sql[] = "INSERT INTO " . $table_prefix . "config VALUES ("support_image",'images/support.gif')";

for( $i = 0; $i < count($sql); $i++ )
{
	if( !$result = $db->sql_query ($sql[$i]) )
	{
		$error = $db->sql_error();

		echo '<li>' . $sql[$i] . '<br /> +++ <font color="#FF0000"><b>Error:</b></font> ' . $error['message'] . '</li><br />';
	}
	else
	{
		echo '<li>' . $sql[$i] . '<br /> +++ <font color="#00AA00"><b>Successfull</b></font></li><br />';
	}
}


echo '</ul></span></td></tr><tr><td class="catBottom" height="28">&nbsp;</td></tr>';

echo '<tr><th>End</th></tr><tr><td><span class="genmed">Installation is now finished. Please be sure to delete this file now.<br />If you have run into any errors, please visit the <a href="http://www.phpbb.com/phpBB" >PHPBB support forums</a> and ask someone for help.</span></td></tr>';
echo '<tr><td class="catBottom" height="28" align="center"><span class="genmed"><a href="' . append_sid("index.$phpEx") . '">Have a nice day</a></span></td></table>';

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>
is the file please help!

Posted: Fri Jan 23, 2004 4:52 pm
by Tom_S
Just run the query in phpMyAdmin using:

Code: Select all

INSERT INTO phpbb_config VALUES ("support_status","0");
INSERT INTO phpbb_config VALUES ("support_admin_name","");
INSERT INTO phpbb_config VALUES ("support_onlinetext","");
INSERT INTO phpbb_config VALUES ("support_onlinecontact","");
INSERT INTO phpbb_config VALUES ("support_offlinetext","");
INSERT INTO phpbb_config VALUES ("support_offlinecontact","");
INSERT INTO phpbb_config VALUES ("support_image","images/support.gif");

Posted: Fri Jan 23, 2004 4:57 pm
by pokemaster
i can't i don't have phpmyadmin

tried with phpbbmyadmin and got

Code: Select all

Error in SQL query INSERT INTO phpbb_config VALUES ("
and also

Code: Select all

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '"' at line 1

Posted: Fri Jan 23, 2004 5:06 pm
by Tom_S
pokemaster wrote: i can't i don't have phpmyadmin

tried with phpbbmyadmin and got

Code: Select all

Error in SQL query INSERT INTO phpbb_config VALUES ("
and also

Code: Select all

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '"' at line 1



This is line #55:

Code: Select all

$sql[] = "INSERT INTO " . $table_prefix . "config VALUES ("support_status",'0')"; 
Does that help? I figured you would have phpMyAdmin with all those mods you wrote. :wink:

Posted: Fri Jan 23, 2004 5:22 pm
by ycl6
pokemaster, you either use the following format

Code: Select all

$sql[] = "INSERT INTO " . $table_prefix . "config VALUES ('support_status','0')";
or

Code: Select all

$sql[] = "INSERT INTO " . $table_prefix . "config VALUES (support_status,0)";
Both will be fine, but not

Code: Select all

$sql[] = "INSERT INTO " . $table_prefix . "config VALUES ("support_status","0")";
In this way, you break up the sql statement

~Mac

Posted: Fri Jan 23, 2004 5:22 pm
by pokemaster
i finally made it work.... but had to alter the code to this:

Code: Select all

INSERT INTO phpbb_config (config_name, config_value) values ('support_status','0');
INSERT INTO phpbb_config (config_name, config_value) values ('support_admin_name','');
INSERT INTO phpbb_config (config_name, config_value) values ('support_onlinetext','');
INSERT INTO phpbb_config (config_name, config_value) values ('support_onlinecontact','');
INSERT INTO phpbb_config (config_name, config_value) values ('support_offlinetext','');
INSERT INTO phpbb_config (config_name, config_value) values ('support_offlinecontact','');
INSERT INTO phpbb_config (config_name, config_value) values ('support_image','images/support.gif');