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.


Messages - batu544

Pages: 1 2 3 [4] 5 6 7 8 ... 23
46
Mods & Plugins (Requests & Discussions) / Top Referrer
« on: August 20, 2010, 03:11:02 PM »
Hi All -
             Is it possible store the referrer's domain name and show it on the home page or in any other page ? I think it can be done by changing the sessions.php file.



Any suggestion  for this approach will be appreciated... :)


47
@Rembrandt,
                    Thank you for your help.. but I have already implemented the other way to achieve this..


Regards...
batu544

48
Thanks Sumale.nin for your response and also for the MOD, but my changes/requirement is little bit different and I am currently doing the changes for myself.. I will update my website with this changes in this week only.. :)  . but I must say thank you, because I got the idea of auto closing popup window from your comment_popup.php .

After implementing the changes.. I will post the codes here.. for experts reviews..  :wink:


Thank you.. !!

Updates...

I am almost done with my changes.. but I don't think, the same changes will be required by any other webmasters.. so I am not posting all the code changes..

Here is how my comments.php file looks like...

Code: [Select]
<?php 
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: commnets.php                                         *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.6                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) f&#252;r weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
$main_template 'comment_live';
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 (!
$image_id) {
    
redirect($url);
}

$additional_sql "";
if (!empty(
$additional_image_fields)) {
  foreach (
$additional_image_fields as $key => $val) {
    
$additional_sql .= ", i.".$key;
  }
}

$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_email")."
        FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
        WHERE i.image_id = 
$image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
$image_row $site_db->query_firstrow($sql);
$cat_id = (isset($image_row['cat_id'])) ? $image_row['cat_id'] : 0;
$is_image_owner = ($image_row['user_id'] > USER_AWAITING && $user_info['user_id'] == $image_row['user_id']) ? 0;

if (!
check_permission("auth_viewcat"$cat_id) || !check_permission("auth_viewimage"$cat_id) || !$image_row) {
  
redirect($url);
}
//-----------------------------------------------------
//--- Save Comment ------------------------------------
//-----------------------------------------------------
$error 0;
if (
$action == "postcomment" && isset($HTTP_POST_VARS[URL_ID])) {
  
$id intval($HTTP_POST_VARS[URL_ID]);
  
$sql "SELECT cat_id, image_allow_comments
          FROM "
.IMAGES_TABLE."
          WHERE image_id = 
$id";
  
$row $site_db->query_firstrow($sql);

  if (
$row['image_allow_comments'] == || !check_permission("auth_postcomment"$row['cat_id']) || !$row) {
    
$msg $lang['comments_deactivated'];
  }
  else {
    
$user_name un_htmlspecialchars(trim($HTTP_POST_VARS['user_name']));
    
$comment_headline un_htmlspecialchars(trim($HTTP_POST_VARS['comment_headline']));
    
$comment_text un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));

    
$captcha = (isset($HTTP_POST_VARS['captcha'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['captcha'])) : "";

    
// Flood Check
    
$sql "SELECT comment_ip, comment_date
            FROM "
.COMMENTS_TABLE."
            WHERE image_id = 
$id
            ORDER BY comment_date DESC
            LIMIT 1"
;
    
$spam_row $site_db->query_firstrow($sql);
    
$spamtime $spam_row['comment_date'] + 180;

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

    
$user_name_field get_user_table_field("""user_name");
    if (!empty(
$user_name_field)) {
      if (
$site_db->not_empty("SELECT $user_name_field FROM ".USERS_TABLE." WHERE $user_name_field = '".strtolower($user_name)."' AND ".get_user_table_field("""user_id")." <> '".$user_info['user_id']."'")) {
        
$msg .= (($msg != "") ? "<br />" "").$lang['username_exists'];
        
$error 1;
      }
    }
    if (
$user_name == "")  {
      
$msg .= (($msg != "") ? "<br />" "").$lang['name_required'];
      
$error 1;
    }
//    if ($comment_headline == "")  {
//      $msg .= (($msg != "") ? "<br />" : "").$lang['headline_required'];
//      $error = 1;
//    }
    
if ($comment_text == "")  {
      
$msg .= (($msg != "") ? "<br />" "").$lang['comment_required'];
      
$error 1;
    }

    if (
$captcha_enable_comments && !captcha_validate($captcha)) {
      
$msg .= (($msg != "") ? "<br />" "").$lang['captcha_required'];
      
$error 1;
    }

    if (!
$error)  {
      
$sql "INSERT INTO ".COMMENTS_TABLE."
              (image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
              VALUES
              (
$id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
      
$site_db->query($sql);
      
$commentid $site_db->get_insert_id();
      
update_comment_count($id$user_info['user_id']);
      
$msg "<script type=\"text/javascript\">
        window.setTimeout('self.close()', 10);
        </script>\n"
;
      echo 
$msg;
     } elseif (
$error) {
 echo '<div style="padding: 10px">' $msg '</div>';
 }
  }
  unset(
$row);
  unset(
$spam_row);
}

if (
$image_allow_comments == 0) {
  
//-----------------------------------------------------
  //--- BBCode & Form -----------------------------------
  //-----------------------------------------------------
  
$allow_posting check_permission("auth_postcomment"$cat_id);
  
$bbcode "";
  if (
$config['bb_comments'] == && $allow_posting) {
    
$site_template->register_vars(array(
      
"lang_bbcode" => $lang['bbcode'],
      
"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 (!
$allow_posting) {
    
$comment_form_live "";
  }
  else {
    
$user_name = (isset($HTTP_POST_VARS['user_name']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['user_name'])), 2) : (($user_info['user_level'] != GUEST) ? format_text($user_info['user_name'], 2) : "");
    
$comment_headline = (isset($HTTP_POST_VARS['comment_headline']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_headline'])), 2) : "";
    
$comment_text = (isset($HTTP_POST_VARS['comment_text']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_text'])), 2) : "";

    
$site_template->register_vars(array(
      
"bbcode" => $bbcode,
      
"user_name" => $user_name,
      
"comment_headline" => $comment_headline,
      
"comment_text" => $comment_text,
      
"url_form" => $site_sess->url(ROOT_PATH."comments.php?image_id=$image_id"),
      
"image_id" => $image_id,
      
"lang_post_comment" => $lang['post_comment'],
      
"lang_name" => $lang['name'],
      
"lang_headline" => $lang['headline'],
      
"lang_comment" => $lang['comment'],
      
"lang_captcha" => $lang['captcha'],
      
"lang_captcha_desc" => $lang['captcha_desc'],
      
"captcha_comments" => (bool)$captcha_enable_comments
    
));
    
$comment_form_live $site_template->parse_template("comment_form_live");
  }
  
$site_template->register_vars("comment_form_live"$comment_form_live);
  unset(
$comment_form_live);
  
$site_template->print_template($site_template->parse_template($main_template));
// end if allow_comments



//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  
"msg" => $msg,
  
"clickstream" => $clickstream,
  
"lang_category" => $lang['category'],
  
"lang_added_by" => $lang['added_by'],
  
"lang_description" => $lang['description'],
  
"lang_keywords" => $lang['keywords'],
  
"lang_date" => $lang['date'],
  
"lang_hits" => $lang['hits'],
  
"lang_downloads" => $lang['downloads'],
  
"lang_rating" => $lang['rating'],
  
"lang_votes" => $lang['votes'],
  
"lang_author" => $lang['author'],
  
"lang_comment" => $lang['comment'],
  
"lang_prev_image" => $lang['prev_image'],
  
"lang_next_image" => $lang['next_image'],
  
"lang_file_size" => $lang['file_size']
));

//$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>


Could any php/4image guru review this code and let me know the unwanted parts, so that I can remove it from here...


If anyone wants a demo of this changes .. they can visit any images which is under wallpaper section and try to download any size image..  ( not original version.. Its under development.. :wink:  )

Thank you.

49
Mods & Plugins (Requests & Discussions) / Comment box in a popup window
« on: August 04, 2010, 10:01:23 PM »
Hi All-
            Is it possible to display the comment box in a modal popup window ?? means If someone clicks on the link called "add your comment" , a new modal popup window  will be displayed to enter the comment and after successfully posting a comment it will be auto closed.



Thanks,
batu544

50
well guys.. I have a question ... :)


What is use of href part in the like plugin if you want to use current page ??

by default following line will take current page as the default href..
Code: [Select]
<fb:like layout="standard" show_faces="true" width="200" action="recommend" colorscheme="like" />


Please let me know, if you think it works in some other way...


Thanks,
batu544

51
Discussion & Troubleshooting / Re: Faq and rules
« on: August 02, 2010, 02:18:40 PM »
How is question is related to 4images ??

it always depends on a webmaster whether he wants to put some FAQ stuff on his website. Also, I don't think there would be any special FAQ for a 4image script running photo gallery..



52
This is really great !!.. I just tried the AJAX part and it worked very well...

Thanks V@no for this Mod.. , but I think there is something which is not same between ACP's general whois online part and signature MOD's whois online calculation part, because for me these 2 details always shows me different numbers...


Thank  you.

53
Mods & Plugins (Requests & Discussions) / Online users statistics on ACP
« on: August 01, 2010, 02:47:25 PM »
Hi,
    Is it possible to get small section on the top right hand corner of the ACP panel displaying total users online statistics.. ?? The most important point is.. can it be auto refreshable ??


Thank you ..
 

54
Mods & Plugins (Requests & Discussions) / Login Forever
« on: July 12, 2010, 08:28:48 AM »
Hi,
    Is there anything can be done to stay logged in forever ( until we press logout) when we are in ACP ?

Thanks,
batu544

55
Chit Chat / Re: Looks like a charm
« on: July 11, 2010, 04:11:40 AM »
I am not sure.. but I think I have implemented one sliding effect from this on my website's category pages ... :)


56
Plugins / Re: [Plugin] Rebuild Thumbnails v1.1 (2009-06-21)
« on: July 10, 2010, 12:51:21 PM »
V@no -
          I am using this plugin and its working fine in normal selection, but whenever I am selecting to Javascript to redirect to new page.. its not redirecting to next page after completing the 1st set of images..

Here is the code what I am using..
Code: [Select]
v1.1

Am I only facing this issue or anybody else also ??

Thanks,
batu544

57
That's because you altered my "original" code to produce download-imagename-imageid-downloadsize-widthxheight.htm and forgot to do the same in new version ;)

What a silly mistake I have done ...  :oops:

Now Its working perfectly..the original size link points to the original image with a link format like

/download-imagename-imageid-downloadsize-widthxheight.htm


Thanks for all your help.. :)

58
V@no and budduke-

Here is the test result of the code..

Original size actual link before applying the changes :  http://www.bhwallpapers.com/download-diya-mirza-14272-30-.htm  ( doesn't work )

Please note the above link got generated by processing the link in 4image session url function.


budduke's code :
  It changed the link to look like  : http://www.bhwallpapers.com/download-diya-mirza-14272-30-Original%20Size.htm 

This is what I am expecting, but when clicking on this link.. it doesn't work . It link remains same on the page but actually it displays the homepage for me.. ( the reason of displaying the home page for me is due to my .htaccess code. As per my .htaccess if a not found encountered then it redirects to my home page ).

V@no's code :
  It changed the original size link to ==> http://www.bhwallpapers.com/d-diya-mirza-14272-30-1024x768.htm 
The number 1024x768 changes to different number for different images..

Final result : Original size link not working and this change also affects other download link and non of download link works..




Thanks,
batu544

59
Hi Budduke,
                     I had a discussion with V@no regarding one change and as per V@no, this can be done by you :)

For details about the question..  ==> http://www.4homepages.de/forum/index.php?topic=17598.msg148750#msg148750


For suggested solution ==> http://www.4homepages.de/forum/index.php?topic=17598.msg148764#msg148764
Quote
@batu544:
The problem is, neither the multi size download, nor this mod has actual image dimensions.
I think your best bet would be ask budduke to add additional item into $download_multi_sizes array that would temporary hold original image dimensions.


Is it doable ?

Thanks,
batu544

60
since used the same function as for details.php to generate url, the final url should be the in this format:
Code: [Select]
http://www.bhwallpapers.com/d-image-name-15982-2-1600x1200.htm
Because multidownload mod uses array indexes, the 1600x1200 in the example will only be used as decoration, you can manually change the numbers, but it will not change image size.

V@no,
             Can I put original-size at the end when I encounter &multi_download_select=30 in the url ??



Jinjo52,
            Have you checked your server error log ?? If there is any error message please post it here, may be someone can figure out what's the problem in your case.

Thanks,
batu544

Pages: 1 2 3 [4] 5 6 7 8 ... 23