CyberiaPC.com Community Forums Main Page
RSS Feeds: Late(st) News | Zenith Picture Gallery | Most Recent Community Topics | Tips, Tricks and Other Useful Stuff

Welcome Guest ( Log In | Register )

Reply to this topicStart new topic
> Allowing users to edit their comments + 1 other question
kapangaluis
post Feb 3 2007, 10:10 PM
Post #1


Full Member
Group Icon

Group: +Zenith User
Posts: 92
Joined: 6-February 06
From: Mendoza, Argentina
Member No.: 3,240

Argentina




Hello again!:

I must to make two questions see if you can help me:

1) There is some way to modify some option so that to each member it leaves the option to him “EDIT” in its own commentaries and thus to publish his post?

2) Since I can make to extend the characters allowed in each commentary? As increase the limit? It is good for changing it or it will affect something in the normal function of my gallery?.

Greetings and thank you very much! thumbsup.gif

LUIS
Go to the top of the page
 
+Quote Post
usr.c
post Feb 5 2007, 06:13 AM
Post #2


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




Hi LUIS,

1. I'll post instructions for how to add that mod within the next 24 hours (need to get a bit of rest right now original.gif)

2. Nope, increasing the length of the comment body shouldn't cause you any problems. Just make sure you increase it both in the HTML as well as in your MySQL table.


--------------------


Things that I don't suck at: Photography (flickr, JPG Mag), Skydiving, Splitting atoms, Flying a space shuttle
"Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch
I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com
Go to the top of the page
 
+Quote Post
usr.c
post Feb 6 2007, 09:59 PM
Post #3


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




Try this and let me know if you have problems:

1. Apply the fix mentioned here if you've not already done so.

2. In pic_details.php look for

CODE
showAdminCommentTools($config, $lang, $row);

and below that insert

CODE
showUserCommentTools($config, $lang, $row, $_COOKIE[$cookie_name_username]);


3. In functions/f_global.php look for

CODE
//--------------------------------------------
// getPicturesPath()
// @type_of_path: 0 is internet 1 is server
//--------------------------------------------

and above that insert

CODE
//--------------------------------------------
// showUserCommentTools(): display user options for particular comment
//--------------------------------------------
function showUserCommentTools($config, $lang, $row, $logged_in_username) {
   $orange_box = "border:1px solid;border-color:#FC9 #630 #330 #F96;padding:0 3px;font:bold 10px verdana,sans-serif;color:#fff;background:#F60;text-decoration:none;margin:0";

   //first, add slashes to comments before doing anything with them.
   $row['comment_body'] = addslashes($row['comment_body']);
  
   //if comment was posted by this user, continue
       if(loggedIn($config) && sessionRegistered($config) && $row['comment_author'] == $logged_in_username && $logged_in_username != "" && !adminStatus($config)) {
        echo "<a href='comment_man.php?id={$row['comment_id']}&amp;is_what=comment-edit-form' onclick=\"window.open('comment_man.php?id={$row['comment_id']}&is_what=comment-edit-form','picman','width=600,height=300,resizable=yes');return false\" style='$orange_box'>&nbsp;&nbsp;{$lang['edit']}&nbsp;&nbsp;</a>
    <br/>
    ";
   }
}

Save and upload.


--------------------


Things that I don't suck at: Photography (flickr, JPG Mag), Skydiving, Splitting atoms, Flying a space shuttle
"Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch
I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com
Go to the top of the page
 
+Quote Post
kapangaluis
post Feb 9 2007, 04:55 PM
Post #4


Full Member
Group Icon

Group: +Zenith User
Posts: 92
Joined: 6-February 06
From: Mendoza, Argentina
Member No.: 3,240

Argentina




That's Works! Thankssssssssss!
Go to the top of the page
 
+Quote Post
kapangaluis
post Feb 9 2007, 05:00 PM
Post #5


Full Member
Group Icon

Group: +Zenith User
Posts: 92
Joined: 6-February 06
From: Mendoza, Argentina
Member No.: 3,240

Argentina




Oh oh!!!!!! Problems!!!

The modification worked, that is to say, when a user leaves a commentary, it appears to him the button with the possibility of “EDIT” comment. But there is a problem. When I enter like administrator, no longer they appear the options to me “EDIT” and “DELETE” commentaries of the users.

Where's the problem?.

Greetings

LUIS
Go to the top of the page
 
+Quote Post
usr.c
post Feb 9 2007, 05:04 PM
Post #6


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




Did you maybe replace

CODE
showAdminCommentTools($config, $lang, $row);

with
CODE
showUserCommentTools($config, $lang, $row, $_COOKIE[$cookie_name_username]);

instead of inserting the latter one after the former?


--------------------


Things that I don't suck at: Photography (flickr, JPG Mag), Skydiving, Splitting atoms, Flying a space shuttle
"Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch
I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com
Go to the top of the page
 
+Quote Post
kapangaluis
post Feb 9 2007, 07:58 PM
Post #7


Full Member
Group Icon

Group: +Zenith User
Posts: 92
Joined: 6-February 06
From: Mendoza, Argentina
Member No.: 3,240

Argentina




Yes!!! Ups! My BIG error blushing.gif .

Thank You Very Much! The gallery now are running and more beauty biggrin.gif .

Greetings!

LUIS
Go to the top of the page
 
+Quote Post
kapangaluis
post Feb 14 2007, 05:05 AM
Post #8


Full Member
Group Icon

Group: +Zenith User
Posts: 92
Joined: 6-February 06
From: Mendoza, Argentina
Member No.: 3,240

Argentina




Hello friend:

I have a new problem with this modification. The member sees the button publish (it appears to him), but when it presses in, opens to the new window (pop-up type) to him, but it leaves to him in target, without the dialog box to publish its commentary and to keep it. In which I am being mistaken?. That I have done badly so that does not appear to me?.


I wait for your answer!


Greetings

LUIS


Excuseme for my bad english! blushing.gif
Go to the top of the page
 
+Quote Post
kapangaluis
post Feb 24 2007, 10:47 PM
Post #9


Full Member
Group Icon

Group: +Zenith User
Posts: 92
Joined: 6-February 06
From: Mendoza, Argentina
Member No.: 3,240

Argentina




Im waiting for your answer... blushing.gif
Go to the top of the page
 
+Quote Post
Fernando Machado
post Aug 10 2008, 05:30 PM
Post #10


New Member
*

Group: Members
Posts: 22
Joined: 25-June 08
From: Lisbon -Portugal
Member No.: 9,669

Portugal




QUOTE(kapangaluis @ Feb 24 2007, 11:47 PM) *
Im waiting for your answer... blushing.gif


I have the the same problem just appear the pop up box. sad.gif

This post has been edited by Fernando Machado: Aug 10 2008, 05:31 PM


--------------------
Fernando Machado

Portugal

www.globalfoto.net
Go to the top of the page
 
+Quote Post
Fernando Machado
post Sep 12 2008, 04:22 PM
Post #11


New Member
*

Group: Members
Posts: 22
Joined: 25-June 08
From: Lisbon -Portugal
Member No.: 9,669

Portugal




Hi,

I need a litle help were. whistling.gif


Thanks,


--------------------
Fernando Machado

Portugal

www.globalfoto.net
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 26th May 2013 - 02:18 PM