• [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21) 4 0 5 1
Currently:  

Author Topic: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)  (Read 147676 times)

0 Members and 1 Guest are viewing this topic.

Offline Frank Götze

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Photography Portal Galerie
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #60 on: July 29, 2010, 07:01:35 PM »
Hi V@no,
vielen Dank für diese schöne Modifikation. Leider habe ich das gleiche Problem wie tikle. Der [Mod] Mail Owner of image when Comment is Posted funktioniert nicht in der Kombination mit dem  [MOD] AJAX Comments / Comments Rating v1.0.4. . E- Mails werden nicht verschickt. Gerade um User ansprechen zu können und ihre Aktivitäten in der Galerie zu fördern, wäre dies aus meiner Sicht wichtig und schön.

Deinen Hinweis ...

Quote
Do same modifications in ajaxcomments.php as in details.php

... habe ich versucht umzusetzen. Er hat aber leider nicht zum Erfolg geführt. Es wäre nett, wenn du helfen könntest.

Hier ist der Teil aus meiner details.php:

Code: [Select]
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
   $recipient_name = $image_row['user_name'];
   $recipient_email = $image_row['user_email'];
   $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;

   $sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = '".$recipient_name."'";
   $result = $site_db->query($sql);
   $row = $site_db->fetch_array($result);
   $user_allowemails = ($row['user_allowemails']);

   if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) {
   include(ROOT_PATH.'includes/email.php');
   $site_email = new Email();
   $site_email->set_to($recipient_email);
   $site_email->set_from($config['site_email'], $config['site_name']);
   $site_email->set_subject($lang['send_comment_emailsubject']);
   $site_email->register_vars(array(
     "user_name" => stripslashes($user_name),
     "recipient_name" => stripslashes($image_row['user_name']),
     "image_name" => $image_row['image_name'],
     "comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
     "site_name" => $config['site_name'],
     "image_url" => $image_url,
     "comment_text" =>(stripslashes($comment_text)),
     "comment_headline"=>(stripslashes($comment_headline)),
          ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();
    }
    }
  }
  unset($row);
  unset($spam_row);
}

Wenn ich diesen Code unterhalb der Zeile

Code: [Select]
update_comment_count($id, $user_info['user_id']);
einsetze erfolgt leider trotzdem kein E-Mailversand. Für deine oder die Hilfe anderer User wäre ich dankbar. Hat denn jemand beide MODs gleichzeitig funktionierend eingebaut? Wenn ja, wie muss man vorgehen?

Viele Grüße, Frank.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #61 on: July 30, 2010, 02:51:40 AM »
In ajaxcomments.php find:
      update_comment_count($id$user_info['user_id']);

Insert below :below::

      $current_time time();
      
$sql "SELECT i.image_name, i.user_id" get_user_table_field(", u.""user_name") . get_user_table_field(", u.""user_email") . get_user_table_field(", u.""user_allowemails") . "
              FROM " 
IMAGES_TABLE " i
              LEFT JOIN " 
USERS_TABLE " u ON (" get_user_table_field("u.""user_id") . " = i.user_id)
              WHERE image_id = 
$id";
      
$image_row $site_db->query_firstrow($sql);
      
$image_name $image_row['image_name'];
      
$user_id $image_row['user_id'];
      if (
$image_row['user_id'] != $user_info['user_id'] && $image_row[$user_table_fields['user_allowemails']] == 1)
      {
        
$recipient_name $image_row[$user_table_fields['user_name']];
        
$recipient_email $image_row[$user_table_fields['user_email']];
        
$image_url $script_url."/details.php?".URL_IMAGE_ID."=".$id;
    
           
// Start Emailer fur comments
        
include(ROOT_PATH.'includes/email.php');
        
$site_email = new Email();
        
$site_email->set_to($recipient_email);
        
$site_email->set_from($config['site_email'], $config['site_name']);
        
$site_email->set_subject("Comment Posted");
        
$site_email->register_vars(array(
          
"user_name" => $recipient_name,
          
"recipient_name" => $recipient_name,
          
"image_name" => $image_row['image_name'],
          
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
          
"site_name" => $config['site_name'],
          
"image_url" => $image_url,
        ));
        
$site_email->set_body("comment_email"$config['language_dir']);
        
$site_email->send_email();
      }
« Last Edit: July 30, 2010, 03:23:14 AM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #62 on: August 01, 2010, 02:03:42 PM »
Hello VANo

you said find

ORDER BY c.comment_date ASC

with


ORDER BY c.comment_date ".(COMMENTS_ORDER ? "DESC" : "ASC")."

Now im confused, when i do, some syntax code after I have replaced it changes to dark brown, this is probebly due to the quote at the end of the code u told us to replace it with, now is this correct and is this what is suppose to happen?

Thank us ir

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #63 on: August 01, 2010, 03:08:09 PM »
I just realized that there are two possible such lines and only one line that needs to be changed.
I've updated step 4.5 with new instructions.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #64 on: August 02, 2010, 02:06:04 PM »
Helo V@no

There seems to be a problem,

ok, number 1, when i post a comment it does not appear in real time, i then refresh the page and then the comment has appeared, at first i thought it was permission set, so i checked it and then it wasnt, i then tried it but previously before the update, comments appeared quickyl, but i think the page refreshed, and i love this MOD as it doesnt require refresh but it doesnt work, no comments appear.

O yeee, anoter thing, when user post 1 comment then they cant post another, when i log in as administrator i can post a comment continuously but i must refresh the page manually for it to appear, like i said i thought it may be the persmissions but it wasnt, and at first i thought it may be the captcha but it wasnt, a user cannot post more than 1 comment and also does not apper in real time... any ideas???

Thanks sir,
« Last Edit: August 02, 2010, 02:20:28 PM by zakaria666 »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #65 on: August 02, 2010, 02:24:52 PM »
ok, number 1, when i post a comment it does not appear in real time, i then refresh the page and then the comment has appeared, at first i thought it was permission set, so i checked it and then it wasnt, i then tried it but previously before the update, comments appeared quickyl, but i think the page refreshed, and i love this MOD as it doesnt require refresh but it doesnt work, no comments appear.
Check for any javascript errors in your browser
Also if you done steps 7 and 8 manually, then try pre-modified attached template files instead

O yeee, anoter thing, when user post 1 comment then they cant post another, when i log in as administrator i can post a comment continuously but i must refresh the page manually for it to appear, any ideas???
4images has built-in flood protection that prohibits non-administrators post more then 1 comment per 2 minutes. Administrators don't have such restriction.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #66 on: August 02, 2010, 02:41:49 PM »
thank u for the reply,

ok here is what  i did

I had previously replaced the pre-modified html 4 part pages into my template, now i have a few problems..

I am using default 960 but now that i have uplaoded the pre-modified page (detail.html) my page had gone smaller to the smaller version default.  also please can u tell me how to remove flood protection as it is stopping me from beta testing it. o ye one more thing, the JS folder, do i place the contents inside the folder into the 4images directory right? not 4images/template/<my template>? or is it the other way round and i have to have the contents inside the JS folder for it to work.
_______________
UPDATE****

Good news, it seems be working however, my pages are in details.html layout isnt 960px while all the other pages are, good news is that comenting works in real time and that now all i need to know is how to tweak the details so that it accepts 960px as i think i know what may have caused it, previously i had uploaded the pre-modifed pages realized the detail.html was default small version and then replaced it back with the default 960, and i think this is what was causing the problem. any ideas how to fix it...

So basically sir, all i ned is ur assistence in...
1) helping me to make the detail.html default 960px
2) stop flood protection to 20seconds not 2 minutes
3) and comment pages being created after 10 comments not 5,

GOD BLESS U sir

Thank u for all the hard work u do for us, i really do appreciate it

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #67 on: August 02, 2010, 02:53:49 PM »
I had previously replaced the pre-modified html 4 part pages into my template, now i have a few problems..
I am using default 960 but now that i have uplaoded the pre-modified page (detail.html) my page had gone smaller to the smaller version default.  
Remember, before you do any other modifications to a mod, make sure that it's working properly, otherwise you'll endup into a crossroads when you won't know was it mod's modifications screwed things up, or yours...So, install the mod without any additional modifications, test it, make sure everything is working properly, then start tweaking.

also please can u tell me how to remove flood protection as it is stopping me from beta testing it.
in details.php and ajaxcomments.php search for number 180 replace it with 0 (don't forget change it back when you are done ;))

o ye one more thing, the JS folder, do i place the contents inside the folder into the 4images directory right? not 4images/template/<my template>?
correct, JS folder must be inside your 4images root directory.

3) and comment pages being created after 10 comments not 5,
There should be a dropdown menu to select how many comments per page will be shown.

Template modifications - compare unmodified default and default_960px templates and do the differences in your templates.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #68 on: August 02, 2010, 03:57:03 PM »
******* update number 2

Sorry i deleted my previous comment, basicailly  in the previous comment i said when i refresh the page the comments are all shown, and for example a user clicks on an image and then they will see, lets say 40 messages all in 1 page, when a user then makes a comment, everything then goes into order, so it will create pages, 1, 2, 3, 4, 5, 6, 7. When i then refresh the page again all the comments are shown in 1 page again, until someone makes comment which thens make allt he comments into pages. And i dont know if there is a bug but if it is like this and this is how it is created, is there a way to stop it being like this? or completly remove the paging comment system altogether.

Any ideas what i do should, P.S i will defiantely test first then modify

thanks mate
« Last Edit: August 02, 2010, 05:06:06 PM by zakaria666 »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #69 on: August 02, 2010, 05:19:53 PM »
if you removed paging for comments, then you'll need remove all changes from steps that marked with "(only if done Step 3)"
and then set COMMENTS_PAGES to 0 (refer to Tweak 1)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #70 on: August 03, 2010, 02:00:49 PM »
V@no, i hope u r ok,

But this is a massive confusion... I deleted my previous comment because i read it 100x trying to see if i made any sense and because u didnt reply to me i thought that maybe i didnt make any sense, but i dont know how to explain it, its very hard my english is not so perfect and i cannot convey what i am trying to say. axxxxx what can i do ok i dont know if u r understanding my position :-(


basiicailly there are 2 very contradictary and confusing coding...

on http://www.4homepages.de/forum/index.php?topic=5830.0 and so to step 1.2, in that code as u see, u saying replace 1 query code for another. Ok no problem. Lets say i do this, i go now into ajax commenting system and on step 4.5 http://www.4homepages.de/forum/index.php?topic=23866.0 You are saying to us to replace one query for an another, but on paging system we already removed this query for another, so you mean remove paging system step 1.2 query now for ajax commenting step 4.5 query.

All night i not sleep becuase i reading my comment for u for last night tying to hope i make 1% sense and trying to see ur code if i am just being stupid :-( but 100/100 i check and check i am confused... what i did is first ajax commenting system, then it was having problem with commenting and i go back now and cover step 3 which i previously skipped, but as you see from my explanation that 1.2 contradicts 4.5 and vice versa. Im sorry Vano, i know i am stupid maybe i make no sense and i hope you can understand what i am saying im sorry please forgive me

:-(

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #71 on: August 03, 2010, 02:48:10 PM »
Now I understand why my original instructions were specifically said to find/replace part of a line...
I've split step 4.5 into two different instructions.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #72 on: August 03, 2010, 03:16:00 PM »
Below is the code that will give me ASC to DESC for the comments so that it shows new comments first then old ones. However

Code: [Select]
$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq").$additional_sql."
         FROM ".COMMENTS_TABLE." c
         LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
         WHERE c.image_id = $image_id
      

         ORDER BY c.comment_date DESC
         LIMIT $offset, $commentperpage";]


The code highlighted red above was replaced by the code below because of Ajax commenting 4.5 MOD, do i revert it back to code above?...

Code: [Select]
 WHERE c.image_id = $image_id
                  ORDER BY c.comment_date ".(COMMENTS_ORDER ? "DESC" : "ASC")."";

, so do i now revert it back? Thanku Vano, you are a good person.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #73 on: August 03, 2010, 03:20:15 PM »
You've said you don't want paging feature, so leave it without LIMIT $offset, $commentperpage
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #74 on: August 03, 2010, 03:26:15 PM »
no sir sorry what i want to have the comments going from new to old regarding the paging, so right now i removed the paging and when i make comments it goes from oldest to newest, i want it to go from newest to oldest so i want the comments to go to the top not be placed at the botoom