Jump to content

chill392

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

chill392's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Like I said, there's a problem with the way it accesses the data. Is there a way for me to reference the ID of the post in the same statement so that I can tell the system to do it on a per-post basis?
  2. Damnit, I forgot to attach the index.php and default.tpl. I feel like an idiot, I've been so out of it lately. Here they are: [attachment deleted by admin]
  3. Yeah, the edit link still does the same thing. ._.;; Name field still bugs out. >_< :'( Thanks for helping!
  4. Thank you so much for taking the time to look at this, I've checked this topic every day for almost a week. I do realize, it is a lot, but I am very new to PHP, and I only know enough to tinker with it. Unfortunately, I'm not at home right now, so I can't implement these codes quite yet. When I get home, I'll post my progress with them, and if/how they work. I've tried something along those lines for the edit link. What happens is that when generating the page, the posts are retrieved and displayed from the newest to the oldest. If I use that, and I am the author of a post, then every post on that page below it will have an edit link too, because it reuses the same author for some reason. That's what I mean when I say it only works to an extent, and nothing I have tried has gotten me any closer to my intention. Also, isAdmin is defined already. Whenever I modify the onBlur statement at all, the entire site crashes, and I can't figure out why. Your method, being different entirely from my attempts, and derived from an actual understanding of PHP might work. Also, about the last question, I didn't want to post like five pages of code, because I'm not really sure where the code I'm talking about begins or ends. Is it ok to post a really long piece of code here? If so, I'll happily post it for you. Again, I greatly appreciate you taking the time to help me, despite the insults to my intelligence. Thank you very, very much.
  5. I have an installation of the database-less blog service Text Rider that I wish to take public, but I want to polish it off, make it prettier, and dumber for the average user before doing so. I want it to be a system where anyone can register and post to the home page, but users can only modify their own posts, whereas administrators can, of course, modify anything. I realize how incredibly stupid this idea is, but I want to go through with it anyways, to learn programming techniques and user habits. One problem is, by default, any user logged in is presented with "edit this post" buttons for every post, regardless of poster. Luckily, if it is not their post, they will not be able to actually edit it. I have attempted to make the if statement only display the button if the user is the author of the post, which works to an extent, but still not enough to actually accept. It is too hard to describe here, for anyone willing to help me, the index.php file that contains this if statement is attached, and the if statement is as follows: if($_COOKIE['username'] == $author){ $edit = "|<a href=?page=edit&x=$ffrow>Edit this post</a>"; }else{ echo ""; } Next is, when a user comments on an article, I want the only logged in users to be able to comment, and I want the username of the commenter to show up, as opposed to the commenter entering the display name in a form. Here is the code for the form, which also is in the attached default.tpl. Name: </td> <td width="289" height="1"><input type="text" name="name" onblur="this.value=TrimValue(this.value);"> <input type="hidden" name="com_id" value={uniq_id}> <input type="hidden" name="ip" value={client_ip}> </td> </tr> <tr> <td width="49" height="1"> Lastly, there is a page in the user control panel called "Modify Posts," which lists all of the posts on the site, each with an edit and delete link on them. I want users to only be able to see their own posts when clicking that link. This bit is too much to include in a quote, so just look in the attached index.php. If anyone could help me at all, I would be forever greatful. Thanks anyways!
  6. I have an installation of the database-less blog service Text Rider that I wish to take public, but I want to polish it off, make it prettier, and dumber for the average user before doing so. I want it to be a system where anyone can register and post to the home page, but users can only modify their own posts, whereas administrators can, of course, modify anything. I realize how incredibly stupid this idea is, but I want to go through with it anyways, to learn programming techniques and user habits. One problem is, by default, any user logged in is presented with "edit this post" buttons for every post, regardless of poster. Luckily, if it is not their post, they will not be able to actually edit it. I have attempted to make the if statement only display the button if the user is the author of the post, which works to an extent, but still not enough to actually accept. It is too hard to describe here, for anyone willing to help me, the index.php file that contains this if statement is attached, and the if statement is as follows: if($_COOKIE['username'] == $author){ $edit = "|<a href=?page=edit&x=$ffrow>Edit this post</a>"; }else{ echo ""; } Next is, when a user comments on an article, I want the only logged in users to be able to comment, and I want the username of the commenter to show up, as opposed to the commenter entering the display name in a form. Here is the code for the form, which also is in the attached default.tpl. Name: </td> <td width="289" height="1"><input type="text" name="name" onblur="this.value=TrimValue(this.value);"> <input type="hidden" name="com_id" value={uniq_id}> <input type="hidden" name="ip" value={client_ip}> </td> </tr> <tr> <td width="49" height="1"> Lastly, there is a page in the user control panel called "Modify Posts," which lists all of the posts on the site, each with an edit and delete link on them. I want users to only be able to see their own posts when clicking that link. This bit is too much to include in a quote, so just look in the attached index.php. If anyone could help me at all, I would be forever greatful. Thanks anyways! [attachment deleted by admin]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.