• [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 147653 times)

0 Members and 1 Guest are viewing this topic.

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 #75 on: August 03, 2010, 03:44:22 PM »
Just read the comments from 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 #76 on: August 29, 2010, 04:59:48 PM »
@Vano,

I need your advice sir,

in step 8.1 it says replace {comment} with

<!--mod ajax comments insert start -->
<a href="#" id="cilh{comment_id}" onClick="return aCTog({comment_id});" style="{if comment_hide}display:inline;{endif comment_hide}{ifno comment_hide}display:none;{endifno comment_hide}"><img id="cih{comment_id}" src="{template_image_url}/plus.png" border="0" /></a>
<div id="commentbox{comment_id}"{if comment_hide} style="display:none;"{endif comment_hide}>
<!--mod ajax comments insert end -->

  {comment_text}

<!--mod ajax comments insert start -->
</div>
<!--mod ajax comments insert end -->


However I have set my dreamweaver to highlight code to yellow if it does not look right. And inside the the code above the divs are highlights yellow. Now please just give me yes or no answer. Because i know u r very busy. Is this how it is suppose to be or is there error inside this code??

thnk u vano.


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 #77 on: August 29, 2010, 08:01:44 PM »
When it comes to 4images templates There is no HTML editor that could possibly show you on 100% if syntax is correct or not, because the template tags will be replaced with true html before page is displayed in your browser.
The only 100% proof if syntax is correct or not, is to view the page's source from the browser.

I can't tell you why it's showing it yellow, perhaps it doesn't like the template tags inside html tags...who knows, do the changes, then validate the HTML code from page source in the browser.

P.S.
Once again, please use [code][/code] tags when showing code, not colored text.
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 x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #78 on: December 01, 2010, 06:36:23 PM »
Hi,

if have installed this mod but have still a problem and i cannot find the solution.
If i enter the details page the comments look like:



the comment vote forms are shown on top and not near the comment it belongs to, but if use the paging and
switch to other comments it looks like:



the comment vote are now shown on top and also to every comment. Now i tried to vote for a comment from
another user this is what happens:



I voted for the bottom comment, then the vote form on top changed and is disabled, and the vote form near
the comment i have voted for is allready available but not clickable ones.

Also the vote counter is not changing at the vote form near the comment only the one on the top.

The Problem must be over the comments table:




Where is the mistake?

I have attached my details.php details.html, comment_form.html, comment_bit.html, comment_popup_form.html & ajaxcomments.php
(I will delete these attachments if i could solve my problem)

@Vano please help me.


Greetz X23
« Last Edit: December 01, 2010, 07:23:47 PM by x23piracy »

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

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 #79 on: December 01, 2010, 10:24:25 PM »
The question is, did it work before you started doing your own modifications?
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 x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #80 on: December 02, 2010, 03:39:13 AM »
The question is, did it work before you started doing your own modifications?

Hi,

what do you mean the comment related files? And all comment related function?
Yes it worked well then i tried to implement your ajax rating and have that
failure after doing it, im sure its something related to my template files but i cannot
understand what part of code is placing all the rate forms on top?

if i place for testing purposes some text in front of the table:

Code: [Select]
<span id="commentstable">
test
<table width="640px" border="0" cellpadding="3" cellspacing="1">

it looks like this:


What is placing the vote forms? is it the span tag?
How can i figure out to fix that?

EDIT:

Maybe it something with with comment_bit.html?
if i remove the comment tag:

Code: [Select]
<!--COMMENTSTART-->
<!--{comments}-->
<!--COMMENTEND-->

All vote forms are gone (sure) also that on top, so i think i have to check the comment_bit.html?!


EDIT2:

Strange, if i disable comment rating in ajaxcomments.php all the comment will be shown in the +
spoiler nevermind what rating they have if i change the pages of comments.

The first view is ok but after changing to another comments page (if paging) only spoilers are shown.

Then i tried to switch paging off but no reaction the paging is allready there
(i have installed paging for comments and universal paging class)
And yes it worked fine before i started with ajaxcomments... hmm im sure i made a mistake but
i cannot find a something missing or wrong related to your installation instructions.

Can you maybe look into my attached files on first post?

EDIT3:

Ok you can stop here, i tried your default template files and there its working fine,
must be some mistaken by me in one of my template files...

...i try to find out my damn bug.


Thanks

EDIT4:

Huh it's the comment_bit.html know i only have to check out whats exactly related to that file. :)
Feel's better now:




Greetz X23
« Last Edit: December 02, 2010, 05:06:43 AM by x23piracy »

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #81 on: December 03, 2010, 08:32:40 AM »
Does anyone know how to show next to username in commets count of +/- rates which member received?

Offline Abu Abdullah

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #82 on: April 09, 2011, 01:05:15 AM »
hi V@no,

thanks for great mod but can we make comments page navigation also in Ajax like youtube with out reload page ?

thank you

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 #83 on: April 09, 2011, 03:38:54 AM »
Yes, that is one of the features of this mod. Review step 3 for more info.
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 Abu Abdullah

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #84 on: April 14, 2011, 05:02:50 PM »
i tried it in my localhost and i notice two things

1- if you play video or flash and switch between comments pages it will reload the page and the video return to first part actually not a big problem but if we can change it like youtube you can switch between comments pages while playing the video :)

2- there is conflict between this mod and SEO in this thread
http://www.4homepages.de/forum/index.php?topic=17598.0

the problem is SEO script replace image_id with blank '' and because of that paging and comments perpage dropdown menu not working

EDIT:
i found solution for comments problem by changing javascript code in ajaxcomments.js

previous code
Code: [Select]
function CommentsPage(obj)
{
  var href = obj.getAttribute("href");
  var Query = href.substr(href.indexOf("?")+1);
  var Url = ajaxCommentsUrl + (ajaxCommentsUrl.indexOf("?") != -1 ? '&' : '?') + 'js&action=commentget&' + Query;
  return !ajaxSend([ajaxCommentsResponse, Url, "GET", null, obj]);
}

function CommentsPerPage(obj)
{
  var Query = ajaxGetFormQuery(obj);
//  var Query = ajaxGetFormQuery(obj,['page', Page]); // use this line if you want stay on the same page number
  var Url = ajaxCommentsUrl + (ajaxCommentsUrl.indexOf("?") != -1 ? '&' : '?') + 'js&action=commentget&' + (obj.getAttribute('action').indexOf("?") != -1 ? obj.getAttribute('action').substring(obj.getAttribute('action').search("\\?")+1) : '');
  return !ajaxSend([ajaxCommentsResponse, Url, "POST", Query, obj]);
}

replace with
Code: [Select]
function CommentsPage(obj)
{
  var href = obj.getAttribute("href");
  var Query = href.substr(href.indexOf("-")+1);
  var Query1 = Query.split(".html?");
  var Url = ajaxCommentsUrl + (ajaxCommentsUrl.indexOf("-") != -1 ? '&' : '?') + 'js&action=commentget&' + 'image_id=' + Query1[0] + '&' +Query1[1];
  return !ajaxSend([ajaxCommentsResponse, Url, "GET", null, obj]);
}

function CommentsPerPage(obj)
{
  var Query = ajaxGetFormQuery(obj);
  var Query1 = obj.getAttribute('action').substring(obj.getAttribute('action').search("\\-")+1);
  var Query2 = Query1.split(".html");
//  var Query = ajaxGetFormQuery(obj,['page', Page]); // use this line if you want stay on the same page number
  var Url = ajaxCommentsUrl + (ajaxCommentsUrl.indexOf("?") != -1 ? '&' : '?') + 'js&action=commentget&' + (obj.getAttribute('action').indexOf("-") != -1 ? 'image_id='+Query2[0]+Query2[1] : '');
  return !ajaxSend([ajaxCommentsResponse, Url, "POST", Query, obj]);
}

because image url after SEO is (image-443.html)
Thank you
« Last Edit: April 15, 2011, 03:52:20 AM by Abu Abdullah »

Offline Warrior

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
    • Lawrence Family History
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #85 on: July 16, 2011, 01:28:51 AM »
Just noticed something- In step 4.6, shouldn't "if (COMMENT_RATING_ANABLE)" be "if (COMMENT_RATING_ENABLE)"?

Offline bma2004

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #86 on: July 19, 2011, 08:37:36 PM »
installed this mod: http://www.4homepages.de/forum/index.php?topic=29664.0

introduced in ajaxcomments.php changes using the code for the original details.php. mod is work, but after adding the comment button quote refers not to details.php? image_id =..., and on ajaxcomments.php. that is when you click on it to pass to a nonexistent page. you refresh the page - everything is working properly.

In addition, when you quote and reply to the message - the window is still open response.

have ideas about how to combine these mods?

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #87 on: October 10, 2011, 04:22:21 PM »
FIX

Problem: When i post a comment the userpic is broken, but when i refresh the page it's there.

If you are using this mod with the "Userpic MOD" and get a broken image after you submit your comment follow those steps:

open ajaxcomments.php

find
Code: [Select]
get_user_table_field(", u.", "user_icq")."
replace with
Code: [Select]
get_user_table_field(", u.", "user_icq")." ,u.userpic,

find
Code: [Select]
"comment_user_ip" => $comment_user_ip,
add below
Code: [Select]
"comment_userpic" => ($config['userpic'] && $comment_row[$i]['userpic']) ? ROOT_PATH."data/userpic/".$comment_row[$i]['userpic'] : "",

thats it - now you dont have a broken image ;)





Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
« Reply #88 on: October 29, 2011, 01:56:58 PM »
V@no,

I am trying to add something to that wonderful mod. I have a custom field named "user_karma". What I am trying to achieve is to update that field depending on how a comment is being rated. For example if someone rates my comment up i get +10 karma, when someone votes it down i get -10.

like "SET user_karma=user_karma+10 WHERE user_id = $user_id";".

I guess I have to modify the function "if ($action == "ratingset")". Can you give me some advise?


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 #89 on: October 29, 2011, 04:45:05 PM »
I'd suggest do it below
  if (!($result $site_db->query($sql)))
    return 
false;
(inside comment_rating_update function)

Something like this:
	
if (
$row['user_id'] != GUEST)
	
{
	
	
$sql "UPDATE " USERS_TABLE "
	
	
	
	
	
	
SET user_karma = user_karma + " 
. ((int)$rating 10 : -10) . "
	
	
	
	
	
	
WHERE " 
get_user_table_field("""user_id") . " = " $row['user_id'];
	
	
$result $site_db->query($sql);
	
}

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)