Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - funpersian

Pages: [1]
1
hi all

This mod will show country flags of your visitors in "Who's online?" in home page !!!

demo





Visit the home page of the tools will be used in this mod:
http://www.maxmind.com/app/geoip_country
Read the licence and make sure its NOT conflicts with your usage.

Download the following files:
1) http://www.maxmind.com/download/geoip/api/php/geoip.inc
Save it in includes/ directory of your 4images installation

2) http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz <- Please Download from Attachment!
Extract the content of this archive (u can use WinZIP, WinRAR, 7-Zip or any other archivers)
Save the extracted file (GeoIP.dat) into includes/ directory (make sure u keep the case: its GeoIP.dat not geoip.dat)

3) http://www.maxmind.com/download/geoip/database/flag.zip
or
http://web.tampabay.rr.com/vano/redirect.html?flags.zip

Extract the flags (again, any compatible archivers would work, Windows XP users dont need any 3-party tools for that)
Save the files into flags/ folder in your 4images root directory.
For visitors with "unknown" or LAN IPs, save this image: as lan.gif into flags/ folder as well
For visitors with using satelite service, save this image: as a2.gif into flags/ folder.


4) Open Files :   includes/sessions.php

Find:

Code:
Code: [Select]
//-----------------------------------------------------
//--- Start Configuration -----------------------------
//-----------------------------------------------------

Add above

Code:
Code: [Select]
/*
  MOD VISITORS COUNTRY FLAGS
  START INSERT
*/
    if (!class_exists("GeoIP"))
    {
      include(ROOT_PATH."includes/geoip.inc");
    }
    
    $gi = geoip_open(ROOT_PATH."includes/GeoIP.dat",GEOIP_STANDARD);
    $countries = array();
/*
  MOD VISITORS COUNTRY FLAGS
  END INSERT
*/

Find:
Code:
Code: [Select]
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];
Add after

Code:
Code: [Select]
/*
  MOD VISITORS COUNTRY FLAGS
  START INSERT
*/
        $cid = geoip_country_code_by_addr($gi, $row['session_ip']);
        if (empty($cid)) $cid = "lan";
        $countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
        $username = "<img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$username;
/*
  MOD VISITORS COUNTRY FLAGS
  END INSERT
*/  

Find:

Code:
Code: [Select]
$num_guests_online++;
Add after
Code:
Code: [Select]
/*
  MOD VISITORS COUNTRY FLAGS
  START INSERT
*/
        $cid = geoip_country_code_by_addr($gi, $row['session_ip']);
        if (empty($cid)) $cid = "lan";
        $countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
        $invitado_online_list  = "<font color=\"#00FFFF\">".$num_guests_online."</font><img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$invitado_online_list ;
/*
  MOD VISITORS COUNTRY FLAGS
  END INSERT
*/
if ($num_guests_online > 1){
$invitado_online_list .= " , ";
}

Find:

Code:
Code: [Select]
"num_guests_online" => $num_guests_online,
Add after

Code:
Code: [Select]
"invitado_online_list" => $invitado_online_list,

save changes


5?) Open templates/<your templates>/whos_online.html

Add

Code: [Select]
{invitado_online_list}
save changes


 :wink: :wink:

2
hi all

i need a mod example site v@no in Whos online
i see flags country guests and users in Whos online


3
Discussion & Troubleshooting / remove viewing online video
« on: April 16, 2005, 09:02:09 AM »
i want to re edit my mpg.html media file.
i remove viewing online video. and i want to add
Movie thumbnail and download url on this how can i do this

i use {thumbnail} command but its same as random image thumbnail.

help me :x



4
Mods & Plugins (Releases & Support) / [MOD] guestbook
« on: April 14, 2005, 09:53:08 AM »
hi all
::;recovery cache google:::


this is MOD by chlee

I created a guest book page. Administrator can specify if guests are allowed to view, post, edit, delete the guestbook entries. The edit and delete function was ip oriented. You could take a look and try it over  Feel free to sign my guestbook but please don't register unless you are a medical specialist and are willing to share you medical images for educational purpose.

First, created a new file guestbook.php in your root directory

Code:
Code: [Select]
<?php 
/************************************************************************** 
 *                                                                        * 
 *    4images - A Web Based Image Gallery Management System               * 
 *    ----------------------------------------------------------------    * 
 *                                                                        * 
 *             File: details.php                                          * 
 *        Copyright: (C) 2002 Jan Sorgalla                                * 
 *            Email: jan@4homepages.de                                    * 
 *              Web: http://www.4homepages.de                             * 
 *    Scriptversion: 1.7                                                  * 
 *                                                                        * 
 *    Never released without support from: Nicky (http://www.nicky.net)   * 
 *                                                                        * 
 ************************************************************************** 
 *                                                                        * 
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       * 
 *    bedingungen (Lizenz.txt) f?r weitere Informationen.                 * 
 *    ---------------------------------------------------------------     * 
 *    This script is NOT freeware! Please read the Copyright Notice       * 
 *    (Licence.txt) for further information.                              * 
 *                                                                        * 
 *************************************************************************/ 

$main_template 'guestbook'
define('GET_CACHES'1); 
define('ROOT_PATH''./'); 
include(
ROOT_PATH.'global.php'); 
require(
ROOT_PATH.'includes/sessions.php'); 
$user_access get_permission(); 
include(
ROOT_PATH.'includes/page_header.php'); 

if (
$config['guestbook_view'] != 1) { 
  
header("Location: ".$site_sess->url(ROOT_PATH."index.php")); 
  exit; 


if (
$action == "") { 
   
$action "showcomments"


if (isset(
$HTTP_GET_VARS[URL_COMMENT_ID]) || isset($HTTP_POST_VARS[URL_COMMENT_ID])) { 
  
$comment_id = (isset($HTTP_GET_VARS[URL_COMMENT_ID])) ? intval($HTTP_GET_VARS[URL_COMMENT_ID]) : intval($HTTP_POST_VARS[URL_COMMENT_ID]); 

else { 
  
$comment_id 0

if (
$action == "deletecomment") { 
  if (!
$comment_id || ($config['user_delete_guestbook'] != && $user_info['user_level'] != ADMIN)) { 
    
show_error_page($lang['no_permission']); 
    exit; 
  } 
  
  
$sql "SELECT comment_id, comment_ip 
          FROM "
.GUESTBOOK_TABLE.
          WHERE comment_id = 
$comment_id"
  
$comment_row $site_db->query_firstrow($sql); 
  if (!
$comment_row || ($comment_row['comment_ip'] != $session_info['session_ip'] && $user_info['user_level'] != ADMIN)) { 
    
show_error_page($lang['no_permission']); 
    exit; 
  } 
  
  
$txt_clickstream $lang['comment_delete']; 
  
  
$sql "DELETE FROM ".GUESTBOOK_TABLE.
          WHERE comment_id = 
$comment_id"
  
$result $site_db->query($sql); 
  
  
$msg = ($result) ? $lang['comment_delete_success'] : $lang['comment_delete_error']; 


if (
$action == "removecomment") { 
  if (!
$comment_id || ($config['user_delete_guestbook'] != && $user_info['user_level'] != ADMIN)) { 
    
header("Location: ".$site_sess->url($url"&")); 
    exit; 
  } 

  
$sql "SELECT comment_id, user_name AS comment_user_name, comment_site, comment_text, comment_ip 
          FROM "
.GUESTBOOK_TABLE.
          WHERE comment_id = 
$comment_id"
  
$comment_row $site_db->query_firstrow($sql); 
  if (!
$comment_row || ($comment_row['comment_ip'] != $session_info['session_ip'] && $user_info['user_level'] != ADMIN)) { 
    
header("Location: ".$site_sess->url($url"&")); 
    exit; 
  } 

  
$txt_clickstream $lang['comment_delete']; 
  
$comment_user_name $comment_row['comment_user_name']; 
  
  
$site_template->register_vars(array( 
    
"comment_id" => $comment_id
    
"comment_user_name" => htmlspecialchars($comment_user_name), 
    
"comment_site" => format_text($comment_row['comment_site'], 0$config['wordwrap_comments'], 00), 
    
"comment_text" => format_text($comment_row['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']), 
    
"lang_delete_comment" => $lang['comment_delete'], 
    
"lang_delete_comment_confirm" => $lang['comment_delete_confirm'], 
    
"lang_name" => $lang['name'], 
    
"lang_site" => $lang['site'], 
    
"lang_comment" => $lang['comment'], 
    
"lang_submit" => $lang['submit'], 
    
"lang_reset" => $lang['reset'], 
    
"lang_yes" => $lang['yes'], 
    
"lang_no" => $lang['no'
  )); 
  
$contents $site_template->parse_template("guestbook_deletecomment"); 


if (
$action == "updatecomment") { 
  if (!
$comment_id || ($config['user_edit_guestbook'] != && $user_info['user_level'] != ADMIN)) { 
    
show_error_page($lang['no_permission']); 
    exit; 
  } 
  
$sql "SELECT comment_id, comment_ip 
          FROM "
.GUESTBOOK_TABLE."  
          WHERE comment_id = 
$comment_id"
  
$comment_row $site_db->query_firstrow($sql); 
  if (!
$comment_row || ($comment_row['comment_ip'] != $session_info['session_ip'] && $user_info['user_level'] != ADMIN)) { 
    
show_error_page($lang['no_permission']); 
    exit; 
  } 
  
  
$txt_clickstream $lang['comment_edit']; 
  
  
$error 0
  
  
$comment_site un_htmlspecialchars(trim($HTTP_POST_VARS['comment_site'])); 
  
$comment_text un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text'])); 
  
$comment_user_name un_htmlspecialchars(trim($HTTP_POST_VARS['comment_user_name'])); 
  
  if (
$comment_user_name == "")  { 
      
$msg .= (($msg != "") ? "<br />" "").$lang['name_required']; 
      
$error 1
    } elseif (
$site_db->not_empty("SELECT user_name FROM "
                              
GUESTBOOK_TABLE
                           
" WHERE user_name= '".strtolower($comment_user_name)."' AND comment_date > ".(time()-60 60 24))) { 
      
$msg .= (($msg != "") ? "<br />" "").$lang['username_exists']; 
      
$error 1
   } 
    if (
$comment_text == "")  { 
      
$msg .= (($msg != "") ? "<br />" "").$lang['comment_required']; 
      
$error 1
    } 

   if (!
$error)  { 
      if (
$comment_site =="http://") { 
         
$comment_site ""
      } 
      
$sql "UPDATE ".GUESTBOOK_TABLE.
               SET comment_site = '
$comment_site', comment_text = '$comment_text', user_name= '$comment_user_name
            WHERE comment_id = 
$comment_id"
      
$result $site_db->query($sql); 
      
$msg = ($result) ? $lang['comment_edit_success'] : $lang['comment_edit_error']; 
   } else { 
      
$action "editcomment"
      
$sendprocess 1
   } 


if (
$action == "editcomment") { 
  if (!
$comment_id || ($config['user_edit_guestbook'] != && $user_info['user_level'] != ADMIN)) { 
    
show_error_page($lang['no_permission']); 
    exit; 
  } 

  
$sql "SELECT comment_id, user_name AS comment_user_name, comment_site, comment_text, comment_ip 
          FROM "
.GUESTBOOK_TABLE.
        WHERE comment_id = 
$comment_id"
  
$comment_row $site_db->query_firstrow($sql); 
  if (!
$comment_row || ($comment_row['comment_ip'] != $session_info['session_ip'] && $user_info['user_level'] != ADMIN)) { 
    
show_error_page($lang['no_permission']); 
    exit; 
  } 
  
  
$txt_clickstream $lang['comment_edit']; 

  
$comment_site = (isset($HTTP_POST_VARS['comment_site'])) ? un_htmlspecialchars(stripslashes(trim($HTTP_POST_VARS['comment_site']))) : (empty($comment_row['comment_site']) ? "http://" $comment_row['comment_site']); 
  
$comment_text = (isset($HTTP_POST_VARS['comment_text'])) ? un_htmlspecialchars(stripslashes(trim($HTTP_POST_VARS['comment_text']))) : $comment_row['comment_text']; 
  
$comment_user_name = (isset($HTTP_POST_VARS['comment_user_name'])) ? un_htmlspecialchars(stripslashes(trim($HTTP_POST_VARS['comment_user_name']))) : $comment_row['comment_user_name']; 

  
$bbcode ""
  if (
$config['bb_comments'] == 1) { 
    
$site_template->register_vars(array( 
      
"lang_bbcode" => $lang['bbcode'], 
     
"smiles_text" => get_smiles_text(), 
      
"lang_tag_prompt" => $lang['tag_prompt'], 
      
"lang_link_text_prompt" => $lang['link_text_prompt'], 
      
"lang_link_url_prompt" => $lang['link_url_prompt'], 
      
"lang_link_email_prompt" => $lang['link_email_prompt'], 
      
"lang_list_type_prompt" => $lang['list_type_prompt'], 
      
"lang_list_item_prompt" => $lang['list_item_prompt'
    )); 
    
$bbcode $site_template->parse_template("bbcode"); 
  } 

  
$site_template->register_vars(array( 
    
"bbcode" => $bbcode
    
"comment_id" => $comment_id
    
"comment_user_name" => htmlspecialchars($comment_user_name), 
    
"comment_site" => htmlspecialchars($comment_site), 
    
"comment_text" => htmlspecialchars($comment_text), 
    
"lang_edit_comment" => $lang['comment_edit'], 
    
"lang_name" => $lang['name'], 
    
"lang_site" => $lang['site'], 
    
"lang_comment" => $lang['comment'], 
    
"lang_submit" => $lang['submit'], 
    
"lang_reset" => $lang['reset'], 
    
"lang_yes" => $lang['yes'], 
    
"lang_no" => $lang['no'], 
  )); 
  
$contents $site_template->parse_template("guestbook_editcomment"); 


//----------------------------------------------------- 
//--- Save Comment ------------------------------------ 
//----------------------------------------------------- 
$error 0
if (
$action == "postcomment" && $config['guestbook_post'] == 1) { 
    
$comment_user_name un_htmlspecialchars(trim($HTTP_POST_VARS['comment_user_name'])); 
    
$comment_text un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text'])); 
   
$comment_site un_htmlspecialchars(trim($HTTP_POST_VARS['comment_site'])); 
    
// Flood Check 
   
$sql "SELECT comment_ip, comment_date 
              FROM "
.GUESTBOOK_TABLE.
         WHERE comment_ip = '"
.$session_info['session_ip']."'  
         ORDER BY comment_date DESC 
         LIMIT 1"

   
$spam_row $site_db->query_firstrow($sql); 
   
$spamtime $spam_row['comment_date'] + 360

   if (
time() <= $spamtime && $user_info['user_level'] != ADMIN)  { 
      
$msg .= (($msg != "") ? "<br />" "").$lang['spamming']; 
      
$error 1
   } 

   if (
$comment_user_name == "")  { 
      
$msg .= (($msg != "") ? "<br />" "").$lang['name_required']; 
      
$error 1
    } elseif (
$site_db->not_empty("SELECT user_name FROM "
                              
GUESTBOOK_TABLE
                           
" WHERE user_name= '".strtolower($comment_user_name)."' AND comment_date > ".(time()-60 60 24))) { 
      
$msg .= (($msg != "") ? "<br />" "").$lang['username_exists']; 
      
$error 1
   } 
    if (
$comment_text == "")  { 
      
$msg .= (($msg != "") ? "<br />" "").$lang['comment_required']; 
      
$error 1
    } 

   if (!
$error)  { 
      if (
$comment_site =="http://") { 
         
$comment_site ""
      } 
      
$sql "INSERT INTO ".GUESTBOOK_TABLE.
               (user_name, comment_site, comment_text, comment_ip, comment_date) 
            VALUES 
            ('
$comment_user_name', '$comment_site', '$comment_text', '".$session_info['session_ip']."', ".time().")"
      
$site_db->query($sql); 
   } 
   unset(
$spam_row); 



//----------------------------------------------------- 
//---Show Guestbook Comments--------------------------- 
//----------------------------------------------------- 

if (($action == "showcomments" || $action == "postcomment" ) && $config['guestbook_view'] == 1) { 
     if (isset(
$HTTP_POST_VARS['commentsetperpage']) || isset($HTTP_GET_VARS['commentsetperpage'])) { 
      
$commentsetperpage = (intval($HTTP_POST_VARS['commentsetperpage']) ) ? intval($HTTP_POST_VARS['commentsetperpage']) : intval($HTTP_GET_VARS['commentsetperpage']); 
      if (
$commentsetperpage) { 
         
$site_sess->set_session_var("commentperpage"$commentsetperpage); 
         
$session_info['commentperpage'] = $commentsetperpage
      } 
   } 

   if (isset(
$session_info['commentperpage'])) { 
      
$commentperpage $session_info['commentperpage']; 
   } else { 
      
$commentperpage 8
   } 
  
   
$sql "SELECT COUNT(user_name) AS comments 
          FROM "
.GUESTBOOK_TABLE
   
$result $site_db->query_firstrow($sql); 
   
$num_comments $result['comments']; 
   
$site_db->free_result(); 
   
$num_rows_all = (isset($num_comments)) ? $num_comments 0
   
$link_arg $site_sess->url(ROOT_PATH."guestbook.php");  
   include_once(
ROOT_PATH.'includes/paging.php'); 
   
$getpaging = new Paging($page$commentperpage$num_rows_all$link_arg); 
   
$offset $getpaging->get_offset(); 
   
$site_template->register_vars(array( 
        
"paging" => $getpaging->get_paging(), 
      
"paging_stats" => $getpaging->get_paging_stats() 
   )); 

   
$sql "SELECT comment_id, user_name AS comment_user_name, comment_site, comment_text, comment_ip, comment_date 
         FROM "
.GUESTBOOK_TABLE.
         ORDER BY comment_date DESC 
         LIMIT 
$offset$commentperpage"
  
   
$result $site_db->query($sql); 
   
$comment_row = array(); 
   while (
$row $site_db->fetch_array($result)) { 
      
$comment_row[] = $row
   } 
   
$site_db->free_result($result); 
   
$num_comments sizeof($comment_row); 
   
$comments ""
    
   
$site_template->register_vars(array( 
        
"lang_guest_from" => $lang['guest_from'], 
      
"lang_guest_site" => $lang['guest_site'
   )); 
   if (
$num_comments) { 
      
$bgcounter 0
      for (
$i 0$i $num_comments$i++) { 
         
$row_bg_number = ($bgcounter++ % == 0) ? 2

         
$comment_user_name htmlspecialchars($comment_row[$i]['comment_user_name']); 
         
$comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : ""

         
$admin_links ""
         if (
$user_info['user_level'] == ADMIN) { 
            
$admin_links .= "<a href=\""
                          
$site_sess->url(ROOT_PATH."guestbook.php?action=editcomment&amp;comment_id="
                                         
$comment_row[$i]['comment_id']). 
                          
"\" target=\"admin_edit\">".$lang['edit']."</a>&nbsp;"
            
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."guestbook.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id'])."\" target=\"admin_edit\">".$lang['delete']."</a>"
         } elseif (
$comment_row[$i]['comment_ip'] == $session_info['session_ip']) { // if ip equals, permit to edit 
            
$admin_links .= ($config['user_edit_guestbook'] != 1) ? "" 
                          
"<a href=\"".$site_sess->url(ROOT_PATH."guestbook.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id'])."\" target=\"admin_edit\">".$lang['edit']."</a>&nbsp;"
            
$admin_links .= ($config['user_delete_guestbook'] != 1) ? "" 
                          
"<a href=\"".$site_sess->url(ROOT_PATH."guestbook.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id'])."\" target=\"admin_edit\">".$lang['delete']."</a>"
         } 
         
$site_template->register_vars(array( 
            
"comment_id" => $comment_row[$i]['comment_id'], 
            
"comment_user_name" => $comment_user_name
            
"comment_user_ip" => $comment_user_ip
            
"comment_site" => format_text($comment_row[$i]['comment_site'], 0$config['wordwrap_comments'], 00), 
            
"comment_text" => format_text($comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']), 
            
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $comment_row[$i]['comment_date']), 
            
"row_bg_number" => $row_bg_number
            
"admin_links" => $admin_links
         )); 
            
$comments .= $site_template->parse_template("guestbook_comment_bit"); 
          
      } 
// end for 
   
} else { 
      
$comments $lang['be_the_first']; 
   } 
   
//---End Show Guestbook Comments---- 


  //----------------------------------------------------- 
  //--- BBCode & Form ----------------------------------- 
  //----------------------------------------------------- 
  
$bbcode ""
  if (
$config['bb_comments'] == 1) { 
    
$site_template->register_vars(array( 
      
"lang_bbcode" => $lang['bbcode'], 
     
"smiles_text" => get_smiles_text(), 
      
"lang_tag_prompt" => $lang['tag_prompt'], 
      
"lang_link_text_prompt" => $lang['link_text_prompt'], 
      
"lang_link_url_prompt" => $lang['link_url_prompt'], 
      
"lang_link_email_prompt" => $lang['link_email_prompt'], 
      
"lang_list_type_prompt" => $lang['list_type_prompt'], 
      
"lang_list_item_prompt" => $lang['list_item_prompt'
    )); 
    
$bbcode $site_template->parse_template("bbcode"); 
  } 

  if (
$config['guestbook_post'] != 1) { 
     
$comment_form ""
  } else { 
  
$comment_user_name = (isset($HTTP_POST_VARS['comment_user_name']) && $error) ? stripslashes(htmlspecialchars(trim($HTTP_POST_VARS['comment_user_name']))) : (($user_info['user_level'] != GUEST) ? htmlspecialchars($user_info['user_name']) : ""); 
  
$comment_site = (isset($HTTP_POST_VARS['comment_site']) && $error) ? stripslashes(htmlspecialchars(trim($HTTP_POST_VARS['comment_site']))) : "http://"

  
$site_template->register_vars(array( 
     
"bbcode" => $bbcode
      
"comment_user_name" => $comment_user_name
      
"comment_site" => $comment_site
      
"comment_text" => $comment_text
      
"lang_post_guestbook" => $lang['post_guestbook'], 
      
"lang_name" => $lang['name'], 
      
"lang_site" => $lang['site'], 
      
"lang_comment" => $lang['comment'
    )); 
    
$comment_form $site_template->parse_template("guestbook_form"); 
   
$site_template->register_vars("guestbook_form"$comment_form); 
   
$contents $site_template->parse_template("guestbook_showcomments"); 
   unset(
$comment_form); 
  } 
// end if allow_comments 
  
$txt_clickstream $lang['post_guestbook']; 


//----------------------------------------------------- 
//---Clickstream--------------------------------------- 
//----------------------------------------------------- 
$clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'
            .
"<a href=\"".$site_sess->url(ROOT_PATH."guestbook.php?action=showcomments")."\">".$lang['guestbook']."</a>".$config['category_separator'].$txt_clickstream."</span>"

//----------------------------------------------------- 
//--- Print Out --------------------------------------- 
//----------------------------------------------------- 
$site_template->register_vars(array( 
  
"contents" => $contents
  
"guestbook_comments" => $comments
  
"lang_sign_my_guestbook" => $lang['sign_my_guestbook'], 
  
"msg" => $msg
  
"clickstream" => $clickstream 
)); 
unset(
$contents); 
$site_template->print_template($site_template->parse_template($main_template)); 
include(
ROOT_PATH.'includes/page_footer.php'); 

?>


Then open lang/your_lang/main.php and add these definitions

code:
Code: [Select]
$lang['guestbook'] = "GuestBook";
$lang['site'] = "Your Homepage:";
$lang['post_guestbook'] = "Sign our GuestBook";
$lang['sign_my_guestbook'] = "Please sign our GuestBook";
$lang['be_the_first'] = "Be the first to sign our GuestBook";
$lang['guest_site'] = "Homepage:";
$lang['guest_from'] = "From:";


And these into lang/your_lang/admin.php

code:
Code: [Select]
/*-- Setting-Group 11 --*/
$setting_group[11]="GuestBook";
$setting['guestbook_view'] = "Allow view GuestBook";
$setting['guestbook_post'] = "Allow post GuestBook";
$setting['user_delete_guestbook'] = "Allow delete post in GuestBook";
$setting['user_edit_guestbook'] = "Allow edit post in GuestBook";

Find this in admin/settings.php

Code:
Code: [Select]
show_form_footer($lang['save_changes'], "", 2);
Add these before it
Code:
Code: [Select]
 show_table_separator($setting_group[11], 2, "#setting_group_11");
  show_setting_row("guestbook_view", "radio");
  show_setting_row("guestbook_post", "radio");
  show_setting_row("user_edit_guestbook", "radio");
  show_setting_row("user_delete_guestbook", "radio");
 


NOTICE: You might need to change the 11 in above code.

Open includes/constants.php and find
Code:
Code: [Select]
// URL Parameters
 


Add these before it
Code:
Code: [Select]
define('GUESTBOOK_TABLE', $table_prefix.'guestbook');
 


Open includes/page_header.php and find
Code:
Code: [Select]
"url_categories" => $site_sess->url(ROOT_PATH."categories.php"),
 


Add this after it
Code:
Code: [Select]
"url_guestbook" => (!empty($url_guestbook)) ? $site_sess->url($url_guestbook) : $site_sess->url(ROOT_PATH."guestbook.php"),
 


Now you need several new template html files. You might need to modify these to make it beautifully incoporated into your site because I am not using a standard theme.

templates/your_template/guestbook.html
Code:
Code: [Select]
{header}
{if msg}<br /><b>{msg}</b>{endif msg}

<br />
{contents}

<br />

{footer}
 


Or just copy the member.html and change the tag {content} to {contents}.

templates/your_template/guestbook_form.html
Code:
Code: [Select]
<script language="JavaScript" src="bbcode.js" type="text/javascript"></script>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
        <tr>
          <td valign="top" class="row1" width="100%">
            <form name="commentform" action="{self}#comments" method="post" onSubmit="return checkForm(this)">
              <table cellpadding="4" cellspacing="0" border="0">
              <tr>
                  <td width="90"><b>{lang_name}</b></td>
                  <td>
                    <input type="text" name="comment_user_name" size="40" value="{comment_user_name}" class="commentinput" />
                  </td>
                </tr>
                <tr>
                  <td width="90"><b>{lang_site}</b></td>
                  <td>
                    <input type="text" name="comment_site" size="40" value="{comment_site}" class="commentinput" />
                  </td>
                </tr>
                <tr>
                  <td width="90" valign="top"><b>{lang_comment}</b></td>
                  <td>
                    <textarea name="comment_text" cols="85" rows="10" class="commenttextarea" wrap="virtual" onSelect="storeCaret(this);" onClick="storeCaret(this);" onKeyUp="storeCaret(this);">{comment_text}</textarea>
                  </td>
                </tr>
            <tr>
                  <td width="90" valign="top">&nbsp;</td>
                  <td>{bbcode}</td>
                </tr>
                <tr>
                  <td width="90" valign="top">&nbsp;</td>
                  <td>
                    <input type="hidden" name="action" value="postcomment" />
                    <input type="hidden" name="id" value="{image_id}" />
                    <input type="submit" name="postbutton" value="{lang_post_guestbook}" class="button" />
                  </td>
                </tr>
              </table>
            </form>
          </td>
        </tr>
      </table>
 

templates/your_template/guestbook_editcomment.html
Code:
Code: [Select]
<script language="JavaScript" src="bbcode.js" type="text/javascript"></script>
<form name="commentform" action="{url_guestbook}" method="post" onsubmit="uploadbutton.disabled=true;">
  <input type="hidden" name="action" value="updatecomment" />
  <input type="hidden" name="comment_id" value="{comment_id}" />

<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<td class="cat" colspan="2">{lang_edit_guestbook}</td>
</tr>

<tr>
  <td class="row2"><b>{lang_name}</b></td>
  <td class="row2">
    <input type="text" name="comment_user_name" size="30" value="{comment_user_name}" class="commentinput" />
  </td>
</tr>
<tr>
  <td class="row2"><b>{lang_site}</b></td>
  <td class="row2">
    <input type="text" name="comment_site" size="30" value="{comment_site}" class="commentinput" />
  </td>
</tr>
<tr>
  <td class="row1" valign="top"><b>{lang_comment}</b></td>
  <td class="row1">
    <textarea name="comment_text" cols="30" rows="10" wrap="virtual" class="commenttextarea"
      onSelect="storeCaret(this);" onClick="storeCaret(this);" onKeyUp="storeCaret(this);">{comment_text}</textarea>
  </td>
</tr>
<tr>
  <td class="row2" valign="top">&nbsp;</td>
  <td class="row2">{bbcode}</td>
</tr>
<tr>
<td class="cat" colspan="2">
  <p align="center">
    <input type="submit" name="uploadbutton" value="{lang_submit}" class="button" />
    <input type="reset" value="{lang_reset}" class="button" />
  </p>
</td>
</tr>
</table>
</form>
 

templates/your_template/guestbook_showcomments.html
Code:
Code: [Select]
<table width="100%" border="0" cellspacing="1" cellpadding="6" class="forumline">
    <tr>
        <td align="left" class="cat" width="100%" >{lang_sign_my_guestbook}</td>
    </tr>
    <tr>
        <td class="row1">
        {guestbook_comments}
      {if paging}
         <br/>
         <span align="center">{paging}</span>
      {endif paging}
        </td>
    </tr>
   <tr>
        <td class="row2">
        {guestbook_form}
        </td>
    </tr>
</table>
 

templates/your_template/guestbook_deletecomment.html
Code:
Code: [Select]
<form method="post" action="{url_guestbook}" onsubmit="uploadbutton.disabled=true;">
  <input type="hidden" name="action" value="deletecomment" />
  <input type="hidden" name="comment_id" value="{comment_id}" />
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<td class="cat">{lang_delete_comment}</td>
</tr>

<tr>
<td class="row2">{lang_delete_comment_confirm}</td>
</tr>

<tr>
<td class="cat">
  <p align="center">
    <input type="submit" name="uploadbutton" value="{lang_yes}" class="button" />
    <input type="button" value="{lang_no}" class="button" onclick="javascript:history.go(-1)" />
  </p>
</td>
</tr>
</table>
</form>
 

templates/your_templates/guestbook_comment_bit.html
Code:
Code: [Select]
<table width="100%" cellspacing="0" cellpadding="4" style="border:solid 1 #CCCCEE">
<tr>
   <td class="commentrow{row_bg_number}" width="80%" ><b>{comment_user_name}</b></td>
   <td class="commentrow{row_bg_number}" align="right" ><small>({lang_release_date}{comment_date})</small></td>
</tr>
<tr>
   <td colspan=2 class="commentrow{row_bg_number}" align="left" style="border-top:solid 1 #DDDDFF">
     {comment_text}
   </td>
</tr>
{if comment_site}
<tr>
   <td colspan=2 class="commentrow{row_bg_number}" align="left" style="border-top:solid 1 #DDDDFF">
     <b>{lang_guest_site}&nbsp;</b>{comment_site}
   </td>
</tr>
{endif comment_site}
{if admin_links}
<tr>
   <td class="commentrow{row_bg_number}" align="left" style="border-top:solid 1 #DDDDFF">
     <b>{lang_guest_from}&nbsp;</b>{comment_user_ip}</td>
   <td class="commentrow{row_bg_number}" align="right" style="border-top:solid 1 #DDDDFF">{admin_links}</td>
</tr>
{endif admin_links}
</table>
<br/>
 
now download this file http://140.112.132.43/install_guestbook.zip


Visit that page

http://your_4images_site/install_guestbook.php


install complete  :wink:


------------------------------------------------------------------------------- :wink:------------------------------------------------------------------------


 :!:this is support for guestbook :?:



 
Some users requested template files for default 4images theme. Basically, you could just copy your templates/your_template/member.html to templates/your_template/guestbook.html and replace the tag {content} to {contents}.

Replace all
Code:
class="forumline"
 

to
Code:

class="bordercolor"
 

in all guestbook_XXXX.html


--------------------------------------------------------- :lol:------------------------------------------

Quote:
- Add badword check to headline
 


To filter user_name for bad words
Find this in guestbook.php
Code:
Code: [Select]
"comment_user_name" => $comment_user_name,
 


change it to
Code:
Code: [Select]
"comment_user_name" => format_text($comment_user_name, $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
 
------------------------------------------------------------ :wink:------------------------------------------------------------

Hello.
I put everything in as you wrote,but in my main page ,there is no "Guestbook" to see.
What did I wrong?

here is the text of the link:

Code: [Select]
<td><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{clickstream}</td>
<td align="right">
<a href="{url_guestbook}"><b>{Guestbook}</b></a>&nbsp;
<a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;
<a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;
Thanks for any lhelp


Open includes/page_header.php and find
Code:

Code: [Select]
"url_categories" => $site_sess->url(ROOT_PATH."categories.php"),
  
 


Add this after it

Code:
Code: [Select]
"lang_guestbook" => $lang['guestbook'],
 

Now you code should be
Code:
Code: [Select]
<td><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{clickstream}</td>
<td align="right">
<a href="{url_guestbook}"><b>{lang_guestbook}</b></a>&nbsp;
<a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;
<a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;

 
------------------------------------------------------ :wink:-----------------------------------------------------------------

Johnny_H wrote:
Works fine this mod  

but i have a little slight problem...

"User name already exists."

when i try to post an entry.... seems only one nick can post.. how to disable?

It is set to restrict one nick can post once each day. If you want to disable it. Find two times in guestbook.php
Code:
Code: [Select]
if ($comment_user_name == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['name_required'];
      $error = 1;
    } elseif ($site_db->not_empty("SELECT user_name FROM ".
                              GUESTBOOK_TABLE.
                           " WHERE user_name= '".strtolower($comment_user_name)."' AND comment_date > ".(time()-60 * 60 * 24))) {
      $msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
      $error = 1;
   }
 
change them to
Code:
Code: [Select]
if ($comment_user_name == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['name_required'];
      $error = 1;
    }
 
--------------------------------------------------------------- :wink:----------------------------------------------

JensF wrote:
Hi there,

what must i do to become a Mail or a PM when a Guest or a Member sign in the Guestbook??


In guestbook.php, find
Code:
Code: [Select]
$sql = "UPDATE ".GUESTBOOK_TABLE."
 

Add before
Code:
Code: [Select]
  //-----------------------------------------------------
   // Start Emailer for guestbook
   //-----------------------------------------------------
   if (!empty($config['guestbook_manager'])) {
      $current_time = time();
      include_once(ROOT_PATH.'includes/email.php');
      $site_email = new Email();
      $site_email->set_to($config['guestbook_manager']);
      $site_email->set_from($config['site_email'], $config['site_name']);
      $site_email->set_subject("Guestbook Edited");
      $site_email->register_vars(array(
        "recipient_name" => "GuestBook Manager",
        "comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
        "comment_username" => $comment_user_name,
        "comment_text" => $comment_text,
        "comment_site" => $comment_site,
        "site_name" => $config['site_name'],
        "user_country" => $user_country
      ));
      $site_email->set_body("guestbook_email", $config['language_dir']);
      $site_email->send_email();
   }
   //--end emailer
 
Find
Code:
Code: [Select]
$sql = "INSERT INTO ".GUESTBOOK_TABLE."
 

Add before
Code:
Code: [Select]
//-----------------------------------------------------
   // Start Emailer for guestbook
   //-----------------------------------------------------
   if (!empty($config['guestbook_manager'])) {
      $current_time = time();
      include_once(ROOT_PATH.'includes/email.php');
      $site_email = new Email();
      $site_email->set_to($config['guestbook_manager']);
      $site_email->set_from($config['site_email'], $config['site_name']);
      $site_email->set_subject("Guestbook Signed");
      $site_email->register_vars(array(
        "recipient_name" => "GuestBook Manager",
        "comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
        "comment_username" => $comment_user_name,
        "comment_text" => $comment_text,
        "comment_site" => $comment_site,
        "site_name" => $config['site_name'],
        "user_country" => $user_country
      ));
      $site_email->set_body("guestbook_email", $config['language_dir']);
      $site_email->send_email();
   }
   //--end emailer
 
In lang/your_lang/admin.php, find
Code:
Code: [Select]
$setting['user_edit_guestbook'] = "Allow edit post in GuestBook";
 
Add after
Code:
Code: [Select]
$setting['guestbook_manager'] = "Email for monitoring GuestBook";
 

In admin/settings.php, find
Code:
Code: [Select]
 show_setting_row("user_delete_guestbook", "radio");
 

Add after
Code:
Code: [Select]
show_setting_row("guestbook_manager");
 


Add a new file: lang/your_lang/email/guestbook_email.html
Code:
Code: [Select]
Dear {recipient_name},

{comment_username} signed our guestbook on {comment_date}
at {site_name}.
...............................................................
{comment_text}

{comment_site}
{user_country}
---------------------------------------------------------------
Thanks for you support to our site.

Best Regards,

{site_name}
 


In phpMyAdmin, add this setting into 4images_settings table
Code:
Code: [Select]
INSERT INTO `4images_settings` ( `setting_name` , `setting_value` )
VALUES (

'guestbook_manager', 'your_email_account@your_emailserver'
)
 

That should work. If you want to disable this feature, keep guestbook_manager field blank.


------------------------------------------------------------ :wink:--------------------------------------------------------

tikle wrote:
Fatal error: Call to undefined function: get_smiles_text() in /home/www/web22/html/foto/guestbook.php on line 362

 


Remove this line in guestbook.php
Code:
Code: [Select]
"smiles_text" => get_smiles_text(),
 


 :wink: :wink: :wink: :wink: :roll:

Edited by mawenzi :
- 22.06.2009 : install_guestbook.zip attached

5
hi
how to change mediaplayer to Thumbnail media in page mpg.htm

i need help :lol:

thank u

6
Mods & Plugins (Requests & Discussions) / problem in poll mod
« on: April 11, 2005, 10:35:14 AM »
hi all

in install install_encuestas.php
see this error

Ejecución:
CREATE TABLE `4images_encuestas` (
orden int(2) unsigned NOT NULL auto_increment,
nombre varchar(50) NOT NULL default '',
visitante varchar(4) NOT NULL default '',
plazo_votacion varchar(10) NOT NULL default '',
fecha_inicio varchar(50) NOT NULL default '',
fecha_cierre varchar(50) NOT NULL default '',
opcion_1 varchar(30) NOT NULL default '',
votos_1 int(2) NOT NULL default '0',
opcion_2 varchar(30) NOT NULL default '',
votos_2 int(2) NOT NULL default '0',
opcion_3 varchar(30) NOT NULL default '',
votos_3 int(2) NOT NULL default '0',
opcion_4 varchar(30) NOT NULL default '',
votos_4 int(2) NOT NULL default '0',
opcion_5 varchar(30) NOT NULL default '',
votos_5 int(2) NOT NULL default '0',
opcion_6 varchar(30) NOT NULL default '',
votos_6 int(2) NOT NULL default '0',
opcion_7 varchar(30) NOT NULL default '',
votos_7 int(2) NOT NULL default '0',
opcion_8 varchar(30) NOT NULL default '',
votos_8 int(2) NOT NULL default '0',
opcion_9 varchar(30) NOT NULL default '',
votos_9 int(2) NOT NULL default '0',
opcion_10 varchar(30) NOT NULL default '',
votos_10 int(2) NOT NULL default '0',
KEY `orden` (`orden`)
)TYPE=MyISAM

Ejecución:
INSERT INTO `4images_encuestas` VALUES ('','Que opinas de esta galería ?', '0', '0', 'Monday - 11 of April of 2005 to them 12:58', '', 'Opcion_1', 0, 'Opcion_2', 0, 'Opcion_3', 0, 'Opcion_4', 0, 'Opcion_5', 0, '', 0, '', 0, '', 0, '', 0, '', 0)


Operación realizada con exito!


please help me :P

7
hi
how to random images on other php file :wink:

8
hi

i need this mod
[MOD] Show Received Comments V.2

help me :wink:

9
Mods & Plugins (Requests & Discussions) / contact us for 4images
« on: March 23, 2005, 11:25:01 AM »
hi
how to create a contact us for 4images 1.7.1

thank u :lol:

10
hi
How can I change max random pic?

11
Mods & Plugins (Requests & Discussions) / max random pic
« on: March 21, 2005, 02:10:34 PM »
hi
how to max random pic for example 3

please help me

12
Mods & Plugins (Requests & Discussions) / latest comment on home page
« on: March 21, 2005, 10:56:24 AM »
hi
how to make latest comments on home page
 



please help me :P

13
Mods & Plugins (Requests & Discussions) / random pic on details.html
« on: March 21, 2005, 10:53:39 AM »
hi
how to random pic on details.html

please help me :roll:

Pages: [1]