4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
August 19, 2018, 11:15:20 AM

Login with username, password and session length
Search:     Advanced search
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support) (Moderators: mawenzi, Rembrandt)
| | |-+  [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: «« « 1 2 3 4 5 [6] 7 » »» Print
Current Topic Rating: ****
Author Topic: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)  (Read 102532 times)
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 577

mmm PHP...


View Profile WWW
« Reply #75 on: August 03, 2010, 03:44:22 PM »

Just read the comments from tweak 1.
Logged

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)
zakaria666
Full Member
***
Offline Offline

Posts: 211

Thank You
-Given: 55
-Receive: 2


View Profile
« 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.

Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 577

mmm PHP...


View Profile WWW
« 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.
Logged

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)
x23piracy
Sr. Member
****
Offline Offline

Posts: 420

Thank You
-Given: 48
-Receive: 41


View Profile WWW
« 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

* details.html (7.01 KB - downloaded 0 times.)
* details.php (39.99 KB - downloaded 2 times.)
* ajaxcomments.php (31.5 KB - downloaded 0 times.)
* comment_form.html (1.95 KB - downloaded 0 times.)
* comment_bit.html (2.05 KB - downloaded 1 times.)
* comment_popup_form.html (3.22 KB - downloaded 0 times.)
« Last Edit: December 01, 2010, 07:23:47 PM by x23piracy » Logged


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!

--(◔̯◔)--
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 577

mmm PHP...


View Profile WWW
« Reply #79 on: December 01, 2010, 10:24:25 PM »

The question is, did it work before you started doing your own modifications?
Logged

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)
x23piracy
Sr. Member
****
Offline Offline

Posts: 420

Thank You
-Given: 48
-Receive: 41


View Profile WWW
« 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:

1
2
3
<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:

1
2
3
<!--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. Smile
Feel's better now:




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


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!

--(◔̯◔)--
Lucifix
Hero Member
*****
Offline Offline

Posts: 710

Thank You
-Given: 8
-Receive: 15


View Profile WWW
« 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?
Logged

Abu Abdullah
Newbie
*
Offline Offline

Posts: 19

Thank You
-Given: 0
-Receive: 0


View Profile
« 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
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 577

mmm PHP...


View Profile WWW
« 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.
Logged

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)
Abu Abdullah
Newbie
*
Offline Offline

Posts: 19

Thank You
-Given: 0
-Receive: 0


View Profile
« 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 Smile

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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 » Logged
Warrior
Jr. Member
**
Offline Offline

Posts: 73

Thank You
-Given: 13
-Receive: 8


View Profile WWW
« 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)"?
Logged

bma2004
Newbie
*
Offline Offline

Posts: 32

Thank You
-Given: 0
-Receive: 0


View Profile
« 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?
Logged
trez
Hero Member
*****
Offline Offline

Posts: 613

Thank You
-Given: 12
-Receive: 26


View Profile WWW
« 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
1
get_user_table_field(", u.", "user_icq")."

replace with
1
get_user_table_field(", u.", "user_icq")." ,u.userpic,


find
1
"comment_user_ip" => $comment_user_ip,

add below
1
"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 Wink




Logged

trez
Hero Member
*****
Offline Offline

Posts: 613

Thank You
-Given: 12
-Receive: 26


View Profile WWW
« 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?

Logged

V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 577

mmm PHP...


View Profile WWW
« Reply #89 on: October 29, 2011, 04:45:05 PM »

I'd suggest do it below
1
2
  if (!($result $site_db->query($sql)))
    return 
false;
(inside comment_rating_update function)

Something like this:
1
2
3
4
5
6
7
	
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);
	
}
Logged

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)
Pages: «« « 1 2 3 4 5 [6] 7 » »» Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.063 seconds with 19 queries.