PDA

View Full Version : aproved... not aproved hack!


TaP
07-15-2002, 07:20 AM
i was wondering if someone could make a hack.... there would be 2 buttons in the post

the frist button would be the aproved button. if the post is aproved by a mod you click that button and it edits the post and puts

"this post has been aproved by $username at $date $time"

then you got not aproved button wich would do

"this post has been NOT been aproved by $username at $date $time"

and it would close the post

this would be very usefull and i dont think to hard...

if someone could please make this i would be very thankfull and impressed

Thanks

TaP
07-16-2002, 05:56 AM
bump?

TaP
07-17-2002, 06:35 AM
any one?
yes or no

Xenon
07-18-2002, 09:04 PM
yes it can be done very easy it think.
you have to edit functions.php the getpostbit-section

edit the postbittemplate

and add a small section to for example editpost.php to link at ;)

but i don't think it's usefull, because post is edited, so everyone can change it ;)

or do you talk about threads?
yes it's also possible then, but i don't think it's too usefull, because moderation of threads has nearly the same effect

TaP
07-19-2002, 07:23 PM
couldnt this be done the same way as the reason to close hack? but just make a seprate button that would put the aproved and not close the thread

Xenon
07-19-2002, 10:21 PM
yes, it wouldn't be hard to make such a hack

just add a field to the thread-table
add one small block to posting.php
also a small ifclause to showthread.php
and a change of showthread template.
and of course 2 buttons to draw ;)

TaP
07-20-2002, 06:31 AM
can ya do the code and ill do the buttons?

Xenon
07-20-2002, 12:30 PM
ok, have done the code, but it's not perfect nor tested use it on your own risk ;)

TaP
07-21-2002, 06:45 AM
can you add the date and time and user it was aproved or not aproved by?

TaP
07-21-2002, 06:57 AM
this is the error im getting

Parse error: parse error in /home/sim/public_html/tap/board/postings.php on line 8

line 8 would be

$DB_site->query("UPDATE thread SET aproving='this thread has been NOT aproved by ".$bbuserinfo[username]." at ".vbdate($dateformat,time())."' WHERE threadid=".$threadid);

TaP
07-21-2002, 07:03 AM
ah never mind igot it... one more question... is there any way i can templateize what it says when i click aproved or not aproved?
?

liek givei t some tables or something?

TaP
07-21-2002, 07:05 AM
eh sorry 1 more thing.. when you apove a thread it doesnt show the butons again soo i cant not aprove or aprove it agian.

TaP
07-21-2002, 07:12 AM
also for the aprove button can you make it open the thread if it has already been closed?

Xenon
07-21-2002, 03:42 PM
oh boy not so much at one time ;)

1. time and username are included as i know ;)
2. templatization: (<- nice word ^^)
add eval("\$thread[aproving] = \"".gettemplate("aproving")."\";");
in showthread.php after if(trim($thread[aproving])=="" && ismoderator($thread['forumid'])) {
eval("\$apbuttons = \"".gettemplate("apbuttons")."\";");
} else {


then create a template aproving and put $thread[aproving] in it ;)

3. "when you apove a thread it doesnt show the butons again soo i cant not aprove or aprove it agian."
yes this was planed ;)
if you don't want this just remove the trim($thread[aproving])=="" && from the if clause

TaP
07-21-2002, 09:29 PM
if i remove

if you don't want this just remove the trim($thread[aproving])=="" && from the if clause

i get a parse error

TaP
07-21-2002, 09:36 PM
ok i got the above to work... but i was wondering if there was a way to get the time in the statment.. couse it only shows user name and date

TaP
07-21-2002, 09:39 PM
btw for the templtate thing... i was talking about this

this thread has been NOT aproved by ".$bbuserinfo[username]." at ".vbdate($dateformat,time()

can that be templateized?

TaP
07-21-2002, 09:47 PM
ya.... i just tried what you told me in a few posts back and it didnt work for the tempplate

TaP
07-21-2002, 09:48 PM
here is the template code i used

<td bgcolor="{tableheadbgcolor}" width="175" nowrap><smallfont color="{tableheadtextcolor}"><b><img src="{imagesfolder}/off.gif" alt="Aproved Status"> Status: </b></smallfont></td>
<td bgcolor="{tableheadbgcolor}" width="100%">

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<td width="100%"><smallfont olor="{tableheadtextcolor}"><b>$thread[aproving]</b></smallfont></table>

Xenon
07-22-2002, 03:49 PM
hmm, you can alter $dateformat to whatever you want, so you can add time yourself....

hmm, normaly you should be able to templateisize te aproving term:

add eval("\$apnoterm = \"".gettemplate("apnoterm")."\";");
just before
$DB_site->query("UPDATE thread SET aproving='this thread has been NOT aproved by ".$bbuserinfo[username]." at ".vbdate($dateformat,time())."' WHERE threadid=".$threadid);

and change the query to this:
$DB_site->query("UPDATE thread SET aproving='".$apnoterm."' WHERE threadid=".$threadid);

it should work then