Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Suggestions and Feature Requests

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 05-03-2011, 06:31 PM
rickasawr's Avatar
rickasawr rickasawr is offline
Member
 
Join Date: Apr 2011
Location: United States
Posts: 51
Gender: Male
Credits: 7,534
rickasawr is on a distinguished road
Default Edit/ delete shoutbox posts

yeah, i dont really like going to my MySQL database to edit/ delete shoutbox comments, so maybe make a script to edit/ delete shoutbox posts?

I would love you forever.
Reply With Quote
  #2  
Old 05-03-2011, 10:54 PM
Kaeliah's Avatar
Kaeliah Kaeliah is offline
Premium Member
 
Join Date: Sep 2010
Location: Pennsylvania, United States
Posts: 485
Gender: Female
Credits: 32,283
Kaeliah will become famous soon enough
Send a message via AIM to Kaeliah Send a message via MSN to Kaeliah
Default

Alright. In the shoutbox php, just after the start script paste this:

PHP Code:
$act $_GET['act'];
if(
$act == 'delete'){
    
// Delete the one shout.
    
$group getgroup();
    if(
$group == || $group == 2){
        
$id $_GET['id'];
        
runquery("DELETE FROM ".$prefix."shoutbox WHERE id='$id'");
        
$result 'Shout was deleted.<br><br>';
    }

Then replace the ENTIRE while loop(it's the only one on the page) with this:

PHP Code:
while ($i $num) {
    
$id=@mysql_result($result,$i,"id");
    
$user=@mysql_result($result,$i,"user");
    
$date=@mysql_result($result,$i,"date");
    
$nolinecomment=@mysql_result($result,$i,"comment");
    
$nolinecomment bbconvert($nolinecomment);
    
$comment=nl2br($nolinecomment);
    
$group getgroup();
    if(
$group == || $group == 2){
        
$mod_shoutbox '<br><a href="shoutbox.php?act=delete&id='.$id.'">Delete</a>';
    }
    
$commentdiv "<div class='comment' style='width:94%;padding:2%;background-color:aliceblue;margin-bottom:5px;'><div class='userdate' style='width:50%;height:25px;color:red;'>".$user." - ".$date."</div>".$comment.$mod_shoutbox"</div>";
    
$article_content $article_content.$commentdiv;
    
$i++;

while to } (end bracket).

That should do it for ya. Let me know if there's any issues.
__________________
[My Shop] ♥ [My Blog] ♥ [Subscribe] ♥ [My Mods] ♥ [Mod TOS]
Reply With Quote
  #3  
Old 05-05-2011, 11:19 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 333,204
Hall of Famer is on a distinguished road
Default

Well actually, the shoutbox will undergo a completely redesign in Mys v1.3.0... Anyway nice solution to this problem, Kaeliah.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #4  
Old 05-05-2011, 11:56 AM
Nemesis's Avatar
Nemesis Nemesis is offline
Member
 
Join Date: Mar 2011
Location: Ohio, United States
Posts: 641
Gender: Male
Credits: 48,975
Nemesis is on a distinguished road
Default

lol i was gonna suggest the sql upon reading the topic glad kaeliah could come up with an nice fix. And i can't wait for Mys v1.3.0 the security issues will be fixed right?
Reply With Quote
  #5  
Old 05-05-2011, 04:17 PM
Kaeliah's Avatar
Kaeliah Kaeliah is offline
Premium Member
 
Join Date: Sep 2010
Location: Pennsylvania, United States
Posts: 485
Gender: Female
Credits: 32,283
Kaeliah will become famous soon enough
Send a message via AIM to Kaeliah Send a message via MSN to Kaeliah
Default

Yes, that is priority one for 1.3.0. It will also be much more efficient with some random stupid codes being removed.
__________________
[My Shop] ♥ [My Blog] ♥ [Subscribe] ♥ [My Mods] ♥ [Mod TOS]
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shoutbox? parayna Questions and Supports 17 10-30-2013 03:59 PM
Shoutbox Alaric Questions and Supports 2 12-21-2011 01:53 PM
Longer Shoutbox ipengu Mys v1.2.x Mods 0 08-20-2011 02:28 PM
Forum Editing Posts? PTGigi Feedback and Suggestions 7 01-25-2011 09:29 PM
Create/Edit/Delete user's owned adoptables through acp! Hall of Famer Mys v1.1.x Mods 7 01-24-2011 02:45 PM


All times are GMT -5. The time now is 04:18 AM.

Currently Active Users: 9764 (0 members and 9764 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636