• [MOD] Shoutbox 4 0 5 1
Currently:  

Author Topic: [MOD] Shoutbox  (Read 321642 times)

0 Members and 1 Guest are viewing this topic.

Offline f1do

  • Pre-Newbie
  • Posts: 5
    • View Profile
[MOD] Shoutbox
« on: November 23, 2005, 04:38:08 PM »
Shoutbox v1.1

Version history:
#V1.1
-Various security fixes (Special thanks to TheOracle)
-New editor engine
---------------------------------------------------------------------------------------------------------
Features:
    -Automated installation
    -Admin Panel
       -Activate/Desactivate shutbox
       -Optional allow guests to shout
       -Optional BBcode
       -Optional HTML
    -Totaly editable template
    -Users can edit their shouts
    -Users can delete their shouts
    -Language support:
       -English
       -Spanish
       -German(by mawenzi)
       -Note, if anybody translate it to another language, PM me and I´ll post it here and credit you of ourse.
Download: http://www.f1do.york-networks.com/gallery/shoutboxmod/
Sample site: http://www.f1do.york-networks.com/gallery/
Admin user:-username: test
                 -password: test
---------------------------------------------------------------------------------------------------------
New files to upload:
/shout_editor.php
/includes/shout.php
/admin/plugins/shoutbox_admin.php
/templates/your_template/shout_bit.html
/templates/your_template/shout_form.html
/templates/your_template/shout_editor.html

-------------------------------------------------------------------------------------------------------
Files to edit:
/includes/constants.php
/includes/page_header.php
/lang/your_language/main.php
/lang/your_language/admin.php
/templates/your_template/style.css
/templates/your_template/header.html
(optional)/templates/your_template/home.html
(optional)/templates/your_template/categories.html
(optional)/templates/your_template/details.html
(optional)/templates/your_template/lightbox.html
(optional)/templates/your_template/member.html

------------------------------------------------------------------------------------------------------
Instalation:
1 Edit files
1.1 Open /includes/page_header.php

Find:
Code: [Select]
//-----------------------------------------------------
//--- User Box ----------------------------------------
//-----------------------------------------------------

Before Add:
Code: [Select]
//-----------------------------------------------------
//--- Shoutbox ----------------------------------------
//-----------------------------------------------------

include (ROOT_PATH.'includes/shout.php');

1.2 Open /templates/your_template/style.css

Find:
Code: [Select]
/*--Categories------------------------------------------------*/
Before add:
Code: [Select]
/*--Shoutbox--------------------------------------------------*/
.shouts {
border: 1px;
border-style:solid;
border-color: #004C75;
height: 120px;
width: 148px;
padding: 0px;
overflow: auto;
}

.shoutinput {
  background-color: #FFFFFF;
  font-family: Tahoma,Verdana,Arial,Helvetica,sans-serif;
  color: #0f5475;
  font-size: 11px;
  WIDTH: 130px;
}

.shouttextarea {
  font-family: Tahoma,Verdana,Arial,Helvetica,sans-serif;
  color: #0f5475;
  font-size: 11px;
}

1.3 Open /templates/your_template/header.html

Find:
Code: [Select]
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;

After add:
Code: [Select]
  function popup(mylink, windowname) {
    if (! window.focus)return true;
      var href;
    if (typeof(mylink) == 'string')
      href=mylink;
    else
      href=mylink.href;
    window.open(href, windowname, 'width=170,height=240,scrollbars=no');
    return false;
  }

Open /includes/constants.php

Find:
Code: [Select]
define('WORDMATCH_TABLE', $table_prefix.'wordmatch');
Add after:
Code: [Select]
define('SHOUTBOX_TABLE', $table_prefix.'shoutbox');

2 Languge configuration
2.1 Open /lang/your_language/main.php

Find:
Code: [Select]
?>
Before add(ONLY YOUR LANGUAGE):
[ENGLISH]
Code: [Select]
//-----------------------------------------------------
//--- Shoutbox ----------------------------------------
//-----------------------------------------------------
$lang['shoutbox'] = "Shoutbox";
$lang['sh_e_nouser'] = "Please insert a name.";
$lang['sh_e_nomessage'] = "Please insert a message.";
$lang['sh_e_usrlgth'] = "The name should be shorter than ".$config['sh_usr_lgth']." characters.";
$lang['sh_e_msglgth'] = "The message should be shorter than ".$config['sh_msg_lgth']." words.";
$lang['sh_e_inactive'] = "Sorry, the shoutbox is disabled for the timebeing.";
$lang['sh_e_register'] = "Please register to use the shoutbox";
$lang['sh_name'] = "Name:";
$lang['sh_message'] = "Message:";
$lang['sh_edit'] = "Edit";
$lang['sh_edited'] = "Shout Edited";
$lang['sh_delete'] = "Delete";
$lang['sh_ask_delete'] = "Delete Shout?";
$lang['sh_deleted'] = "The shout was deleted";
$lang['sh_close'] = "[Close Window]";

[SPANISH]
Code: [Select]
//-----------------------------------------------------
//--- Shoutbox ----------------------------------------
//-----------------------------------------------------
$lang['shoutbox'] = "Shoutbox";
$lang['sh_e_nouser'] = "Escribe un nombre por favor.";
$lang['sh_e_nomessage'] = "Escribe un mensaje por favor.";
$lang['sh_e_usrlgth'] = "El nombre debe ser de menos de ".$config['sh_usr_lgth']." caracteres.";
$lang['sh_e_msglgth'] = "El mensaje debe ser de menos de ".$config['sh_msg_lgth']." palabras.";
$lang['sh_e_inactive'] = "Lo siento, pero el Shoutbox esta desabilitado en este momento.";
$lang['sh_e_register'] = "Por favor, registrese para usar la shoutbox";
$lang['sh_name'] = "Nombre:";
$lang['sh_message'] = "Mensaje:";
$lang['sh_edit'] = "Editar";
$lang['sh_edited'] = "Shout Editado";
$lang['sh_delete'] = "Borrar";
$lang['sh_ask_delete'] = "Borrar mensaje?";
$lang['sh_deleted'] = "El mensaje fue borrado";
$lang['sh_close'] = "[Cerrar Ventana]";

[GERMAN](by mawenzi)
Code: [Select]
//-----------------------------------------------------
//--- Shoutbox ----------------------------------------
//-----------------------------------------------------
$lang['shoutbox'] = "Shoutbox";
$lang['sh_e_nouser'] = "Bitte trage deinen Namen ein.";
$lang['sh_e_nomessage'] = "Bitte trage eine Nachricht ein.";
$lang['sh_e_usrlgth'] = "Der Name sollte kürzer sein als ".$config['sh_usr_lgth']." Buchstaben.";
$lang['sh_e_msglgth'] = "Die Nachricht sollte kürzer sein als ".$config['sh_msg_lgth']." Wörter.";
$lang['sh_e_inactive'] = "Sorry, die Shoutbox ist vorläufig gesperrt.";
$lang['sh_e_register'] = "Bitte registriere dich, um die Shoutbox zu nutzen.";
$lang['sh_name'] = "Name:";
$lang['sh_message'] = "Nachricht:";
$lang['sh_edit'] = "Edit";
$lang['sh_edited'] = "Nachricht bearbeiten?";
$lang['sh_delete'] = "Delete";
$lang['sh_ask_delete'] = "Nachricht löschen?";
$lang['sh_deleted'] = "Die Nachricht wurde gelöscht";
$lang['sh_close'] = "[schließen]";


2.2 Open: /lang/your_language/admin.php

Find:
Code: [Select]
?>
Add before(ONLY YOUR LANGUAGE):

[ENGLISH]
Code: [Select]
//-----------------------------------------------------
//--- Shoutbox ----------------------------------------
//-----------------------------------------------------
$lang['sh_not_updated'] = "Settings couldn't be updated";
$lang['sh_not_installed'] = "Installation couldn't be completed";
$lang['sh_cfg'] = "Shoutbox Configuration";
$lang['sh_activate'] = "Activate Shoutbox";
$lang['sh_allow_guests'] = "Allow guests to post";
$lang['sh_usr_lgth'] = "Username Length(less than 50 characters)";
$lang['sh_msg_lgth'] = "Message Length(in words)";
$lang['sh_wordwrap'] = "wordwrap";
$lang['sh_bbcode'] = "Allow BBcode";
$lang['sh_bbimg'] = "Allow BBcode images";
$lang['sh_html'] = "Allow HTML";
$lang['sh_msg_display'] = "Cuantity of shouts to display on the template";
$lang['sh_install'] = "Install Shoutbox";
$lang['sh_installed'] = "The shoutbox is installed and configured";
$lang['sh_back'] = "Back to Shoutbox Admin";
$lang['sh_currnt'] = "<h1>Current Shouts</h1>\n";
$lang['sh_deletes'] = "Delete";
$lang['sh_number'] = "Shout Number";
$lang['sh_name'] = "Name";
$lang['sh_message'] = "Message";
$lang['sh_date'] = "date";
$lang['sh_options'] = "Options";
$lang['sh_delete'] = "Delete Shouts";
$lang['sh_deleted'] = "The Shouts where deleted \n";
$lang['sh_update'] = "Update Settings";
$lang['sh_updated'] = "Settings Updated \n";

[SPANISH]
Code: [Select]
//-----------------------------------------------------
//--- Shoutbox ----------------------------------------
//-----------------------------------------------------
$lang['sh_not_updated'] = "La configuracion no pudo ser guardada";
$lang['sh_not_installed'] = "No se pudo completar la instalación";
$lang['sh_cfg'] = "Configuración de la Shoutbox";
$lang['sh_activate'] = "Activar la Shoutbox";
$lang['sh_allow_guests'] = "Permitir que visiantes manden mensajes";
$lang['sh_usr_lgth'] = "Longitud Del Nombre(menor que 50 caracteres)";
$lang['sh_msg_lgth'] = "Longitud Del Mensaje(en palabras)";
$lang['sh_wordwrap'] = "wordwrap";
$lang['sh_bbcode'] = "Permitir BBcode";
$lang['sh_bbimg'] = "permitir imagenes BBcode";
$lang['sh_html'] = "Permitir HTML";
$lang['sh_msg_display'] = "Cantidad de mensajes para mostrar";
$lang['sh_install'] = "Instalar la Shoutbox";
$lang['sh_installed'] = "La Shoutbox está instalada y configurada";
$lang['sh_back'] = "Volver al administrador de la shoutbox";
$lang['sh_currnt'] = "<h1>Mensajes</h1>\n";
$lang['sh_deletes'] = "Borrar";
$lang['sh_number'] = "Numero de mensaje";
$lang['sh_name'] = "Nombre";
$lang['sh_message'] = "Mensaje";
$lang['sh_date'] = "Fecha";
$lang['sh_options'] = "Opciones";
$lang['sh_delete'] = "Borrar Mensajes";
$lang['sh_deleted'] = "Los Mensajes Fueron Borrados \n";
$lang['sh_update'] = "Guardar Configuración";
$lang['sh_updated'] = "Configuración guardada \n";

[GERMAN](by mawenzi)
Code: [Select]
//-----------------------------------------------------
//--- Shoutbox ----------------------------------------
//-----------------------------------------------------
$lang['sh_not_updated'] = "Die Einstellungen konnten nicht aktualisiert werden.";
$lang['sh_not_installed'] = "Die Installation konnte nicht durchgef&uuml;hrt werden.";
$lang['sh_cfg'] = "Shoutbox Einstellungen";
$lang['sh_activate'] = "Shoutbox aktivieren";
$lang['sh_allow_guests'] = "G&auml;ste d&uuml;rfen posten";
$lang['sh_usr_lgth'] = "Username L&auml;nge(weniger als 50 Buchstaben)";
$lang['sh_msg_lgth'] = "Nachricht L&auml;nge(in W&ouml;rtern)";
$lang['sh_wordwrap'] = "Zeilenumbruch";
$lang['sh_bbcode'] = "BBCode erlauben";
$lang['sh_bbimg'] = "BBCode Bilder erlauben";
$lang['sh_html'] = "HTML erlauben";
$lang['sh_msg_display'] = "Anzahl der Nachrichten, die im Template angezeigt werden sollen.";
$lang['sh_install'] = "Shoutbox installieren";
$lang['sh_installed'] = "Die shoutbox ist installiert und konfiguriert.";
$lang['sh_back'] = "Zur&uuml;ck zur Shoutbox Administration";
$lang['sh_currnt'] = "<h1>Aktuelle Shouts</h1>\n";
$lang['sh_deletes'] = "L&ouml;schen";
$lang['sh_number'] = "Shout Nummer";
$lang['sh_name'] = "Name";
$lang['sh_message'] = "Nachricht";
$lang['sh_date'] = "Datum";
$lang['sh_options'] = "Optionen";
$lang['sh_delete'] = "Nachrichten l&ouml;schen";
$lang['sh_deleted'] = "Die Nachrichten wurden gel&ouml;scht \n";
$lang['sh_update'] = "Aktualisiere Einstellungen";
$lang['sh_updated'] = "Einstellungen wurden aktualisiert \n";

3 Template configuration

To show The shoutbox all you have to do is insert the code where you want the shoutbox to be. If you put it right after "{endif random_image}" it will look like the sample site. You may edit this code to suit your needs, you can also edit the shout_bit.html and shout_form.html.
I have tried it in home.html, categories.html, details.html, lightbox.html and member.html. I also tried it in the header.html.
One tip: remember to make the width of the table inside the <div> smaller than the width of the <div>(editable in style.css), so that the bottom scrolling bar doesnt appear.

Code: [Select]
<!-- Shoutbox Begin -->
  <table width="148" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td class="head2" height="20"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_shoutbox}</td>
    </tr>
    <tr>
      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
    </tr>
    <tr>
      <td>
    <div class="shouts">
        <table cellpadding="0" cellspacing="0" width="130">
        {shoutings}
        </table>
        </div>
      </td>
    </tr>
    <tr>
     <td align="center" class="row1">
     {shout_form}
     </td>
   </tr>
   <tr>
     <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
   </tr>
 </table>
<!-- Shoutbox End -->

4 Finishing up
Save and upload all files to their corresponding folder.Now login and go to the Control Panel. In the left, under PlugIns, there should be a link: "Shoutbox Admin". There, you have the configuration options, edit them to your needs and click in "Install Shoutbox". Now the settings have been saved, and the shoutbox table has been created.
« Last Edit: June 13, 2008, 09:42:34 PM by Nicky »

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD] Shoutbox
« Reply #1 on: November 23, 2005, 04:52:23 PM »
wooooow awesome !!!  :mrgreen:

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD] Shoutbox
« Reply #2 on: November 23, 2005, 05:41:35 PM »
one problem .... you've forgot the DB Table .... (4images_shoutbox.....) .... :?:

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Shoutbox
« Reply #3 on: November 23, 2005, 06:26:24 PM »
one problem .... you've forgot the DB Table .... (4images_shoutbox.....) .... :?:

... There, you have the configuration options, edit them to your needs and click in "Install Shoutbox". Now the settings have been saved, and the shoutbox table has been created.

PS. very nice feature ... thanks for that ... :wink:
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD] Shoutbox
« Reply #4 on: November 23, 2005, 07:00:38 PM »
ops...sorry......i've forgot check that ........  8O

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD] Shoutbox
« Reply #5 on: November 23, 2005, 07:21:06 PM »
a lil problem ... i've install and this work fine but a lil problem ...

i've wrote some to test it and this work (i.e : test ) , but this text appear in my private messages when i'm reply to someone .... how fix it ? :?:

Offline f1do

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] Shoutbox
« Reply #6 on: November 23, 2005, 10:49:57 PM »
Security Fix(read http://www.4homepages.de/forum/index.php?topic=10545.msg52698#msg52698)
Open /includes/shout.php

Find:
Code: [Select]
    if ($user_info['user_id'] == $shouts[$i]['usrid'] || $user_info['user_level'] == ADMIN){
Replace for:
Code: [Select]
    if (($user_info['user_id'] == $shouts[$i]['usrid']) || ($user_info['user_level'] == ADMIN)){
Or you can also download the files again.
Thanks to TheOracle for reporting this bug, where logged off users could delete other logged off user's posts.

a lil problem ... i've install and this work fine but a lil problem ...

i've wrote some to test it and this work (i.e : test ) , but this text appear in my private messages when i'm reply to someone .... how fix it ? :?:
What private messages? please tell me more about your problem.

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD] Shoutbox
« Reply #7 on: November 23, 2005, 10:59:58 PM »
i'm using PMS , so i've test it , writing "test" on shoutbox , but when someone send a PM and when i ill reply to the same PM , the message i've before post on shoutbox , show me in my reply form (PMS) .

 :?:

Offline f1do

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] Shoutbox
« Reply #8 on: November 23, 2005, 11:39:21 PM »
Ok, i think this should fix that:

Open /includes/shout.php

Find:
Code: [Select]
  $shoutings .= $site_template->parse_template("shout_bit");

Add Before:
Code: [Select]
  $message = "";

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD] Shoutbox
« Reply #9 on: November 23, 2005, 11:54:59 PM »
thanks :) it's working !!  :mrgreen:

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD] Shoutbox
« Reply #10 on: November 24, 2005, 12:22:59 AM »
one simple question...how can i make it work in all pages (memberlist,pms,escuestas,potm,register...etc ) ???

Offline f1do

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] Shoutbox
« Reply #11 on: November 24, 2005, 01:31:35 AM »
The template files i mentioned before are the ones i tryed, as it is included in page_header.php it should work on any page that includes the header.

New Fix
Replace /shout_editor.php , /includes/shout.php and /admin/plugins/shoutbox_admin.php with the ones here.
Big thanks to TheOracle for guiding me in the 4Images code.

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD] Shoutbox
« Reply #12 on: November 24, 2005, 05:18:26 AM »
i've one problem about style ...so this show a huge space without nothing....  and how make it show without scroll bar ??
« Last Edit: May 12, 2006, 01:00:45 AM by Stoleti »

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: [MOD] Shoutbox
« Reply #13 on: November 24, 2005, 01:07:32 PM »
hallo,
when i click on the "shout it" button, i get a blank page..
my page functions again, if I call it again, but no entry in shoutbox is indicated.

Offline Jeevan25

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [MOD] Shoutbox
« Reply #14 on: November 25, 2005, 05:14:02 AM »
Parse error: parse error, unexpected $ in /home/thaitami/public_html/gallery/admin/plugins/shoutbox_admin.php on line 234 i am getting this error while trying to run the file from admincp. but i didn't modify it at all.