• [MOD] Shoutbox 4 0 5 1
Currently:  

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

0 Members and 1 Guest are viewing this topic.

Offline f1do

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] Shoutbox
« Reply #15 on: November 25, 2005, 04:00:17 PM »
New version V1.1
updating from 1.0 to 1.1
Open /includes/constants.php
Find:
Code: [Select]
define('WORDMATCH_TABLE', $table_prefix.'wordmatch');Add after:
Code: [Select]
define('SHOUTBOX_TABLE', $table_prefix.'shoutbox');
Open /templates/your_template/header.html
find:
Code: [Select]
  window.open(href, windowname, 'width=150,height=170,scrollbars=no');Replace for
Code: [Select]
  window.open(href, windowname, 'width=170,height=240,scrollbars=no');
Open /lang/your_language/admin.php
Find:
Code: [Select]
//-----------------------------------------------------
//--- Shoutbox ----------------------------------------
//-----------------------------------------------------
Add after(IN YOUR LANGUAGE):
[ENGLiSH]
Code: [Select]
$lang['sh_not_updated'] = "Settings couldn't be updated";
$lang['sh_not_installed'] = "Installation couldn't be completed";
[SPANISH]
Code: [Select]
$lang['sh_not_updated'] = "La configuracion no pudo ser guardada";
$lang['sh_not_installed'] = "No se pudo completar la instalación";
[GERMAN]
Code: [Select]
$lang['sh_not_updated'] = "Die Einstellungen konnten nicht aktualisiert werden.";
$lang['sh_not_installed'] = "Die Installation konnte nicht durchgeführt werden.";

Now save the files and upload them. Also upload:
/shout_editor.php
/includes/shout.php
/templates/your_template/shout_editor.html
from the new file to download.



i've one problem about style ...so this show a huge space without nothing....  and how make it show with scroll bar ??
Check if it isnt a problem in the template. If not, tell me if u have made any changes to the files. About the scroll bar, i can see it there.
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.
open the templates where you put the shoutbox and find:
Code: [Select]
<form method="post">replace with
Code: [Select]
<form method="post" action="{self}">
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.
Download the file again and upload it.

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD] Shoutbox
« Reply #16 on: November 25, 2005, 07:53:54 PM »
i've tried in different templates, and this do the same a huge blank space on top before comments , like in the image i've posted before  8O

Offline f1do

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] Shoutbox
« Reply #17 on: November 25, 2005, 08:21:00 PM »
can you show me an html output, or give me the address of your web.

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD] Shoutbox
« Reply #18 on: November 26, 2005, 12:22:34 AM »
this is the code where i've insert the html code (for where we want show shoutbox in template)


Code: [Select]
<td>&nbsp;<!-- 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 --></td>

Offline Bear

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Re: [MOD] Shoutbox
« Reply #19 on: November 26, 2005, 08:14:27 AM »
everything went ok and works a treat thank you  :)

just cannot get the edit and delite option to work, instead of editing or deleting the message, it reposts it again.
any ideas whats causing this ???

thank you 

Offline vanish

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • White Album
Re: [MOD] Shoutbox
« Reply #20 on: November 26, 2005, 06:56:03 PM »
find
Code: [Select]
  echo $lang['sh_not_updated'];
  show_text_link($lang['sh_back'], "shoutbox_admin.php?action=main");

add after
Code: [Select]
}

Offline Bear

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Re: [MOD] Shoutbox
« Reply #21 on: November 26, 2005, 09:29:18 PM »
prosume you mean in shoutbox_admin.php

this is that part of code
Code: [Select]
if ($result) {
  echo $lang['sh_updated'];
  show_text_link($lang['sh_back'], "shoutbox_admin.php?action=main");
  } else {
  echo $lang['sh_not_updated'];
  show_text_link($lang['sh_back'], "shoutbox_admin.php?action=main");
    }
}

unset ($active);

added } made no difference would not work.

Any one else got this problem as i cannot edit or delete shouts, all it does is repost them :?

Tried from both admin panel and from home page where i have the shoutbox still no joy.

Thanks again

Offline vanish

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • White Album
Re: [MOD] Shoutbox
« Reply #22 on: November 27, 2005, 11:04:22 AM »
here is working code:
Code: [Select]
<?php // PLUGIN_TITLE: Shoutbox Admin
/*************************************\
**                                   **
**      Shoutbox Mod for 4images     **
**      Version: v1.0(Beta)          **
**      By: f1do                     **
**      Email: f1do.987@gmail.com    **
**      Web: http://f1do.uni.cc      **
**                                   **            
\*************************************/


$nozip 1;
define('IN_CP'1);
$root_path = (!eregi("\/plugins\/"$HTTP_SERVER_VARS['PHP_SELF'])) ? "./../" "./../../";
define('ROOT_PATH'$root_path);
require(
ROOT_PATH.'admin/admin_global.php');
define('SHOUTBOX_TABLE'$table_prefix.'shoutbox');

function 
get_num_words ($text) {
  
$text_words explode (" "$text);
  
$text_words sizeof ($text_words);
  return 
$text_words;
}

show_admin_header();

if (
$action == "") {
  
$action "main";
}

//---------------------------------------------------
//--- Instalation -----------------------------------
//---------------------------------------------------
if ($action == "installshoutbox") {

  
$active un_htmlspecialchars(trim($HTTP_POST_VARS['active']));
  
$allowguests un_htmlspecialchars(trim($HTTP_POST_VARS['allowguests']));
  
$usr_lgth un_htmlspecialchars($HTTP_POST_VARS['usr_lgth']);
  
$msg_lgth un_htmlspecialchars($HTTP_POST_VARS['msg_lgth']);
  
$sh_wordwrap un_htmlspecialchars(trim($HTTP_POST_VARS['sh_wordwrap']));
  
$bbcode trim($HTTP_POST_VARS['bbcode']);
  
$bbimg trim($HTTP_POST_VARS['bbimg']);
  
$html htmlspecialchars(trim($HTTP_POST_VARS['html']));
  
$shouts un_htmlspecialchars(trim($HTTP_POST_VARS['shouts']));

  
$sql "INSERT INTO ".SETTINGS_TABLE."(setting_value,setting_name) VALUES(".$active.",'sh_active')";
  
$result $site_db->query($sql);
  
$sql "INSERT INTO ".SETTINGS_TABLE."(setting_value,setting_name) VALUES(".$allowguests.",'sh_allow_guests')";
  
$result $site_db->query($sql);
  
$sql "INSERT INTO ".SETTINGS_TABLE."(setting_value,setting_name) VALUES(".$usr_lgth.",'sh_usr_lgth')";
  
$result $site_db->query($sql);
  
$sql "INSERT INTO ".SETTINGS_TABLE."(setting_value,setting_name) VALUES(".$msg_lgth.",'sh_msg_lgth')";
  
$result $site_db->query($sql);
  
$sql "INSERT INTO ".SETTINGS_TABLE."(setting_value,setting_name) VALUES(".$sh_wordwrap.",'sh_wordwrap')";
  
$result $site_db->query($sql);
  
$sql "INSERT INTO ".SETTINGS_TABLE."(setting_value,setting_name) VALUES(".$bbcode.",'sh_bbcode')";
  
$result $site_db->query($sql);
  
$sql "INSERT INTO ".SETTINGS_TABLE."(setting_value,setting_name) VALUES(".$bbimg.",'sh_bbimg')";
  
$result $site_db->query($sql);
  
$sql "INSERT INTO ".SETTINGS_TABLE."(setting_value,setting_name) VALUES(".$html.",'sh_html')";
  
$result $site_db->query($sql);
  
$sql "INSERT INTO ".SETTINGS_TABLE."(setting_value,setting_name) VALUES(".$shouts.",'sh_msg_display')";
  
$result $site_db->query($sql);

  
$sql 'CREATE TABLE `4images_shoutbox` ('
       
' `id` INT NOT NULL AUTO_INCREMENT, '
       
' `name` VARCHAR(50) NOT NULL, '
       
' `message` TEXT NOT NULL, '
       
' `date` VARCHAR(15) NOT NULL,'
       
' `ip` VARCHAR(15) NOT NULL,'
       
' `usrid` INT(11) NOT NULL,'
       
' PRIMARY KEY (`id`)'
       
' )'
       
' TYPE = myisam';
  
$result $site_db->query($sql);

  if (
$result) {
    echo 
$lang['sh_installed'];
    
show_text_link($lang['sh_back'], "shoutbox_admin.php?action=main");
  }
  else {
    echo 
$lang['sh_not_installed'];
    
show_text_link($lang['sh_back'], "shoutbox_admin.php?action=main");
  }
}

unset (
$active);
unset (
$allowguests);
unset (
$usr_lgth);
unset (
$msg_lgth);
unset (
$sh_wordwrap);
unset (
$bbcode);
unset (
$bbimg);
unset (
$html);
unset (
$shouts);

if (!isset(
$config['sh_active']) && $action != "installshoutbox") {
  
$action "cfginstallshoutbox";
}

if (
$action == "cfginstallshoutbox") {
  
show_form_header('shoutbox_admin.php','installshoutbox');
  
show_table_header($lang['sh_cfg']);
  
show_radio_row($lang['sh_activate'], "active");
  
show_radio_row($lang['sh_allow_guests'], "allowguests");
  
show_input_row($lang['sh_usr_lgth'],"usr_lgth","15");
  
show_input_row($lang['sh_msg_lgth'],"msg_lgth","50");
  
show_input_row($lang['sh_wordwrap'],"sh_wordwrap","30");
  
show_radio_row($lang['sh_bbcode'], "bbcode");
  
show_radio_row($lang['sh_bbimg'], "bbimg"0);
  
show_radio_row($lang['sh_html'], "html");
  
show_input_row($lang['sh_msg_display'],"shouts","20");
  
show_table_footer();
  
show_form_footer($lang['sh_install'], ""2);
}

//---------------------------------------------
//-------- Admin ------------------------------
//---------------------------------------------

if ($action == "main") {
  
$sql "SELECT * FROM ".SHOUTBOX_TABLE." ORDER BY id DESC";
  
$result $site_db->query($sql);
  while (
$row $site_db->fetch_array($result)) {
    
$shouts[] = $row;
  }
  
$num_shouts sizeof ($shouts);
  if (
$num_shouts 20) {
    
$num_shouts 20;
  }
  if (
$num_shouts 0) {
    
show_form_header('shoutbox_admin.php','deleteshout');
    echo 
"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n<tr>\n<td class=\"tableborder\">\n<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\">\n";
    echo 
"<tr class=\"tableseparator\">\n<td class=\"tableseparator\" width=\"40\"><input name=\"allbox\" type=\"checkbox\" onClick=\"CheckAll()\" /></td>\n";
    echo 
"<td class=\"tableseparator\" width=\"40\">".$lang['sh_number']."</td>\n";
    echo 
"<td class=\"tableseparator\" width=\"70\">".$lang['sh_name']."</td>\n";
    echo 
"<td class=\"tableseparator\">".$lang['sh_message']."</td>\n";
    echo 
"<td class=\"tableseparator\" width=\"100\">".$lang['sh_date']."</td>\n";
    echo 
"<td class=\"tableseparator\" width=\"80\">".$lang['sh_options']."</td></tr>\n";

    for (
$i 0$i $num_shouts$i++) {
      echo 
"<tr class=\"".get_row_bg()."\">\n";
      echo 
"<td><input type=\"checkbox\" name=\"shout_delete[]\" value=\"".$shouts[$i]['id']."\"></td>\n";
      echo 
"<td>".$shouts[$i]['id']."</td>\n";
  echo "<td>".$shouts[$i]['name']."</td>\n";
  echo "<td>".$shouts[$i]['message']."</td>\n";
  echo "<td>".date('d.m.Y H:i:s'$shouts[$i]['date'])."</td>\n";
  echo "<td><a href=\"".ROOT_PATH."shout_editor.php?action=edit&shout_id=".$shouts[$i]['id']."\" target=\"_blank\" onClick=\"return popup(this,'edit_shout')\">".$lang['edit']."</a> <a href=\"".ROOT_PATH."shout_editor.php?action=delete&shout_id=".$shouts[$i]['id']."\" target=\"_blank\" onClick=\"return popup(this,'delete_shout')\">".$lang['delete']."</a></td>\n";
    }
    
show_form_footer($lang['sh_delete'], ""6);
  }
  
show_form_header('shoutbox_admin.php','editconfig');
  
show_table_header($lang['sh_cfg']);
  
show_radio_row($lang['sh_activate'], "active",$config['sh_active']);
  
show_radio_row($lang['sh_allow_guests'], "allowguests",$config['sh_allow_guests']);
  
show_input_row($lang['sh_usr_lgth'],"usr_lgth",$config['sh_usr_lgth']);
  
show_input_row($lang['sh_msg_lgth'],"msg_lgth",$config['sh_msg_lgth']);
  
show_input_row($lang['sh_wordwrap'],"sh_wordwrap",$config['sh_wordwrap']);
  
show_radio_row($lang['sh_bbcode'], "bbcode",$config['sh_bbcode']);
  
show_radio_row($lang['sh_bbimg'], "bbimg",$config['sh_bbimg']);
  
show_radio_row($lang['sh_html'], "html",$config['sh_html']);
  
show_input_row($lang['sh_msg_display'],"shouts",$config['sh_msg_display']);
  
show_table_footer();
  
show_form_footer($lang['sh_update'], ""2);
}

if (
$action == "deleteshout") {
  if (isset(
$HTTP_POST_VARS['shout_delete'])){
    
$shout_delete $HTTP_POST_VARS['shout_delete'];
$num_shout_delete sizeof ($shout_delete);
for ($i 0$i <= $num_shout_delete$i++) {
  $sql "DELETE FROM ".SHOUTBOX_TABLE." WHERE id='".$shout_delete[$i]."'";
  $result $site_db->query($sql);
}
echo $lang['sh_deleted'];
  }  
  
show_text_link($lang['sh_back'], "shoutbox_admin.php?action=main");
}

if (
$action == "editconfig") {

$active un_htmlspecialchars(trim($HTTP_POST_VARS['active']));
$allowguests un_htmlspecialchars(trim($HTTP_POST_VARS['allowguests']));
$usr_lgth un_htmlspecialchars($HTTP_POST_VARS['usr_lgth']);
$msg_lgth un_htmlspecialchars($HTTP_POST_VARS['msg_lgth']);
$sh_wordwrap un_htmlspecialchars(trim($HTTP_POST_VARS['sh_wordwrap']));
$bbcode trim($HTTP_POST_VARS['bbcode']);
$bbimg trim($HTTP_POST_VARS['bbimg']);
$html trim($HTTP_POST_VARS['html']);
$shouts un_htmlspecialchars(trim($HTTP_POST_VARS['shouts']));

  
$sql "UPDATE ".SETTINGS_TABLE." SET setting_value = ".$active." WHERE setting_name = 'sh_active'";
  
$result $site_db->query($sql);
  
$sql "UPDATE ".SETTINGS_TABLE." SET setting_value = ".$allowguests." WHERE setting_name = 'sh_allow_guests'";
  
$result $site_db->query($sql);
  
$sql "UPDATE ".SETTINGS_TABLE." SET setting_value = ".$usr_lgth." WHERE setting_name = 'sh_usr_lgth'";
  
$result $site_db->query($sql);
  
$sql "UPDATE ".SETTINGS_TABLE." SET setting_value = ".$msg_lgth." WHERE setting_name = 'sh_msg_lgth'";
  
$result $site_db->query($sql);
  
$sql "UPDATE ".SETTINGS_TABLE." SET setting_value = ".$sh_wordwrap." WHERE setting_name = 'sh_wordwrap'";
  
$result $site_db->query($sql);
  
$sql "UPDATE ".SETTINGS_TABLE." SET setting_value = ".$bbcode." WHERE setting_name = 'sh_bbcode'";
  
$result $site_db->query($sql);
  
$sql "UPDATE ".SETTINGS_TABLE." SET setting_value = ".$bbimg." WHERE setting_name = 'sh_bbimg'";
  
$result $site_db->query($sql);
  
$sql "UPDATE ".SETTINGS_TABLE." SET setting_value = ".$html." WHERE setting_name = 'sh_html'";
  
$result $site_db->query($sql);
  
$sql "UPDATE ".SETTINGS_TABLE." SET setting_value = ".$shouts." WHERE setting_name = 'sh_msg_display'";
  
$result $site_db->query($sql);
  if (
$result) {
  echo 
$lang['sh_updated'];
  
show_text_link($lang['sh_back'], "shoutbox_admin.php?action=main");
  } else {
  echo 
$lang['sh_not_updated'];
  
show_text_link($lang['sh_back'], "shoutbox_admin.php?action=main");
  }
unset (
$active);
unset (
$allowguests);
unset (
$usr_lgth);
unset (
$msg_lgth);
unset (
$sh_wordwrap);
unset (
$bbcode);
unset (
$bbimg);
unset (
$html);
unset (
$shouts);
}

show_admin_footer();
?>

Offline Bear

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Re: [MOD] Shoutbox
« Reply #23 on: November 27, 2005, 05:39:38 PM »
can now delete from admin cp but not from home page options in shoutbox,
but still cannot edit from either admin cp or home page.

At least i can delete the shouts  :)

Thanks for your time.

Offline Zyga

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: [MOD] Shoutbox
« Reply #24 on: December 16, 2005, 09:22:31 PM »
is it possible to take nick from DB (registered users) and disable nick changes in posts ?


it reloads my whole page and when i put it in iframe it show me just tags like {shout_form} ,{shout_form}..
what im doing wrong ?

i know im still asking about something  :oops:
give me some time...

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [MOD] Shoutbox
« Reply #25 on: December 17, 2005, 12:01:46 AM »
Hi there,

i have installed this Mod but when i write a shout and click the "shout it" button i have a blank page.

to see and test look here -> http://www.terraristik-galerie.de/board.php

Anyone an idea why i have a blank page???
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline castor

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: [MOD] Shoutbox
« Reply #26 on: December 20, 2005, 04:11:42 PM »
hi there, hav a lot of errors,, maybe someone can fix it! other is see, have the same problems..

1. can't delete posts, not as admin, not as user (klick under cp nothing happens blank screen and under site at the delete button,window pops up, press at the delete button->nothing happens
2. when i have done a post, its shows correctly but, when i refresh the site after that, it will post it again.. so now 2* the same

the mod is very nice, so let's fix the error's *g  thx

Offline chip

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • pixelmall.de
Re: [MOD] Shoutbox
« Reply #27 on: December 21, 2005, 08:33:33 PM »
Hi everyone,

nice mod, but when I'm in the ACP and try to click shoutbox admin I get this:


Warning: main(./../admin/admin_global.php) [function.main]: failed to open stream: No such file or directory in /is/htdocs/wp1021617_4KJEKX6SI2/www/pixelmall/admin/plugins/shoutbox_admin.php on line 16

Fatal error: main() [function.require]: Failed opening required './../admin/admin_global.php' (include_path='./:/usr/share/pear/php5/') in /is/htdocs/wp1021617_4KJEKX6SI2/www/pixelmall/admin/plugins/shoutbox_admin.php on line 16


Anyone an idea?

Offline @rtur

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: [MOD] Shoutbox
« Reply #28 on: December 22, 2005, 04:21:42 PM »
How  make multilanguage button shout it!?
Artur

Sorry for my bad English

Offline yellows

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: [MOD] Shoutbox
« Reply #29 on: December 23, 2005, 09:33:14 AM »
getting
Quote
Fatal error: Call to undefined function: safe_htmlspecialchars() in /home/sexymal/public_html/Galeries/includes/shout.php on line 47