Welcome, Guest. Please Login or Register.
May 12, 2025, 10:46:11 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  delete/modify by user « previous next »
Pages: [1] Reply Ignore Print
Author Topic: delete/modify by user  (Read 643 times)
Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
delete/modify by user
« on: March 25, 2003, 05:10:37 AM »
Reply with quote

yesterday I found this new member that in a single afternoon had posted over 50 messages with a ton of bs bothering the other members...

I opened her profile, asked for all her messages and I couldn't modify or delete them from the list of messages by her... I had to open each topic, find the message and then do it

could the modify and delete buttons be included to this page next to the other ones per message? for the moderator or person whose messages are being displayed

even a checkbox for each message to choose the bad posts and bulk delete would be cool, but with the buttons alone I'd be more than happy ;)
Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:delete/modify by user
« Reply #1 on: March 25, 2003, 05:52:01 AM »
Reply with quote

There is a mod for this, Delete Posts By User.
Logged

Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
Re:delete/modify by user
« Reply #2 on: March 25, 2003, 05:20:39 PM »
Reply with quote

ah ok... I checked it out now

but it doesn't do really what I need... that one just deletes every post... I need to pick what to delete and delete, cause there were 4 posts that made sense, the other I deleted

maybe this should be moved to the mod ideas forum...
Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
Re:delete/modify by user
« Reply #3 on: April 08, 2003, 06:12:18 PM »
Reply with quote

ok, I'll try to do this myself... I will ask for a little help anyway hehe

someone please tell me where I find:

  • the code that displays, or not, the modify and delete buttons in a message depending on the user

  • the code used to add the check boxes to choose what messages to delete in the private message inbox

  • the code that displays the user messages when you ask for the last "x" number of posts
I'll try making it a mod when it's done too
Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:delete/modify by user
« Reply #4 on: April 08, 2003, 11:43:18 PM »
Reply with quote

Display.php.  Search for "action=modify".
InstantMessage.php.  Search for "delete_".
Profile.php.  It's the last function.

To find all posts by a user...

SELECT ID_MSG
FROM messages
WHERE ID_MEMBER=$usersID;

(or WHERE posterName='$usersUsername', but ID_MEMBER is better and faster.)

To find all ims by a user...

SELECT ID_IM
FROM instant_messages
WHERE ID_MEMBER_FROM=$usersID;

(or WHERE fromName='$usersUsername', but ID_MEMBER is better and faster.)

-[Unknown]
Logged
Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
Re:delete/modify by user
« Reply #5 on: April 09, 2003, 12:43:17 AM »
Reply with quote

thanks a bunch [Unknown] :)

I'll look at the code and figure it out (rather new to coding) and will try to make it work... will be posting any progress or question here until it's done
Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
Re:delete/modify by user
« Reply #6 on: April 09, 2003, 03:05:52 AM »
Reply with quote

hmm... I found what I was looking for, but I can't make it work for some reason...

after line 1174 in Profile.php, I added this condition I took from Display.php to show the delete and modify buttons next to the default ones:

if (in_array($username, $moderators) || $settings[7] == 'Administrator' || $settings[7] == 'Global Moderator' || ($ID_MEMBER == $muserID && $ID_MEMBER != -1))
{
echo '
<a href="' . $cgi . ';action=modify;msg=' . $mid . ';threadid=' . $viewnum . ';start=' . $start . ';sesc=' . $sc . '">' . $img['modify'] . '</a>' . $menusep . '<a href="javascript:DoConfirm(\'' . $txt[154] . "?','" . $cgi . ';action=modify2;threadid=' . $viewnum . ';msg=' . $mid . ';d=1;start=' . $start . ';sesc=' . $sc . '\');">' . $img['delete'] . '</a>';
}


but for some reason I can't make it work, it says there's a parse error in line 1175, where the if is.. I tried several things, but I come up with an error every time... do you know what I'm doing wrong?
Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:delete/modify by user
« Reply #7 on: April 09, 2003, 06:26:14 AM »
Reply with quote

Show me three lines above that too.

-[Unknown]
Logged
Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
Re:delete/modify by user
« Reply #8 on: April 09, 2003, 07:53:14 AM »
Reply with quote

<td colspan="3" bgcolor="' . $color['catbg'] . '" class="windowbg">
<font size="2">
 <a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . ';action=post;threadid=' . $row['ID_TOPIC'] . ';start=' . $start . ';title=Post+reply">' . $img['reply_sm'] . '</a>' . $menusep . '<a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . ';action=post;threadid=' . $row['ID_TOPIC'] . ';quote=' . $row['ID_MSG'] . ';title=Post+reply">' . $img['replyquote'] . '</a>' . $notify . $menusep . ;


btw, I double checked the error, it wasn't line 1175, it was 1174, 75 was the previous version hehe  ;D

QuoteParse error: parse error in /home/alex/public_html/foros/Sources/Profile.php on line 1174

here's the file in case you wanna check something else:
http://www.alejandro.tv/Profile.zip
« Last Edit: April 09, 2003, 08:01:52 AM by Anguz » Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:delete/modify by user
« Reply #9 on: April 09, 2003, 08:02:27 AM »
Reply with quote

You have at the end...

';title=Post+reply">' . $img['replyquote'] . '</a>' . $notify . $menusep . ;

You should take out that last dot....

-[Unknown]
Logged
Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
Re:delete/modify by user
« Reply #10 on: April 09, 2003, 08:45:58 AM »
Reply with quote

coo, fixed that and now I didn't get that parse error when loading a profile

when asking for the las messages, I do get this message where the new buttons should be, though:

Quote2: Wrong datatype for second argument in call to in_array
(/home/alex/public_html/foros/Sources/Profile.php ln 1175)

before it didn't even load the page, so it's a progress :P
Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:delete/modify by user
« Reply #11 on: April 09, 2003, 09:37:48 AM »
Reply with quote

if (in_array($username, $moderators) || $settings[7] == 'Administrator' || $settings[7] == 'Global Moderator' || ($ID_MEMBER == $muserID && $ID_MEMBER != -1))

Change to:

if ($settings[7] == 'Administrator' || $settings[7] == 'Global Moderator' || ($ID_MEMBER == $row['ID_MEMBER'] && $ID_MEMBER != -1))

-[Unknown]
Logged
Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
Re:delete/modify by user
« Reply #12 on: April 09, 2003, 10:21:13 AM »
Reply with quote

sweet, the buttons are there now  ;D

now I have to make them work lol... when I hit modify, the new page has this error message where the form should be:

QuoteFalla al validar la sesión. Por favor intenta nuevamente.

which translates to "Fails to validate session. Please try again." or something like that

the delete button doesn't do anything, maybe the javascript to confirm the delete? should I add something somewhere else?
Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:delete/modify by user
« Reply #13 on: April 09, 2003, 02:05:40 PM »
Reply with quote

You need to add the javascript confirm function, and globalize $sc.

-[Unknown]
Logged
Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
Re:delete/modify by user
« Reply #14 on: April 09, 2003, 07:50:19 PM »
Reply with quote

ok, I don't get that error anymore, but now it says I'm not authorized to enter that section... like if I wasn't an Admin I guess, but it does display the buttons, so I don't think it's the condition for the buttons which isn't working... maybe something else?

about the delete js function, I echoed it at the beginning of the usersrecentposts () function and it works now, the javascript, but when OKing it the next page gives me this error message:

QuoteYou have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND m.ID_TOPIC=t.ID_TOPIC) LIMIT 1' at line 1
File: /home/alex/public_html/foros/Sources/ModifyMessage.php
Line: 277

???
Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  delete/modify by user « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.014 seconds with 17 queries.