![]() |
moderate.php
just a quick question, i was just reading the script (as i need to make a moderation script) and i'm left wondering, whehter or not this could've been done so much simpler than it was done by jelsoft?
|
I guess it depends what your moderating. Personally I don't find moderate.php overly complex.
|
i just want to take some text in a database and display it, with the options to leave it in the queue, authorise it or delete, i guess my limited knowledge of php is causing problems here, i dunno i just read the script and it seemed to be doing so much more than it needed to
i expected to see; an if //moderation is on and a while // to show the data and give the options to moderate it and that's it really. |
You can probably get away with just adding a column to the table called visible and set it to either 1 (visible) or 0 (invisible/hidden) and add that to the where clause on the query.
eg to get all unmoderated items: [sql]SELECT * FROM tablename WHERE visible = 0[/sql] |
that''s how i've got the database set up, it's just a matter of getting the page in the admincp to moderate the items, i guess i'll have to stop being lazy and actually learn how to make an admincp page, to think all i need is;
Code:
text to moderate | option to approve | option to delete | option to do nothing |
i hate the admin cp, it baffles me completely, everything is 20 times harder than coding for vB front end :( i just don't seem to be able to comprehend the coding, well i can kinda, i can read and understand what it's saying in the moderate.php but then it comes to applying that, it's practically impossible :(
[high]* sabret00the goes for a breather before heading back in for round 3[/high] |
Just keep at it, the only way to learn is to get your hands dirty. That admin cp will look much harder to code for at first, because their is alot of extra code for html output.
|
thanks for that, i'll keep at it :)
i think my main problem is how i would've gone about it and how vb went about doing it is so different, so i'm trying to think like someone else would and it's causing problems but i'll persevere(sp:?) :) |
Quote:
|
well i strapped on my php hat and dove right in, and it's not proving to be all that hard, bar one line that refuses to work
PHP Code:
|
one more thing :o
if PHP Code:
|
*bump*
|
PHP Code:
|
didn't work
|
Can't be ;)
Let's take a look at adminfunctions.php: PHP Code:
|
FWIW the second parameter in print_form_header should be the filename
|
PHP Code:
HTML Code:
<!-- form started: 5 queries executed --> |
@assassingod
Nope. The 1st parameter should be the filename (without .php) and the 2nd should be the action. @sabret00the That's just fine. So where is the problem? |
because i want
HTML Code:
<form action="confessions_moderate.php?do=doconfessions"> |
That's invalid (X)HTML.
The action (script) URL cannot contain parameters. Why in hell would you need/want that? |
why would i want an admin script to be xhtml compliant?
besides surely that's the do as the second parameter in the function definition? and the reason i would like it is because the form needs to get processed somehow and i got the main script/form as confessions_moderate.php and it has proved to work quicker if i put that part of the processing on another part of the script. |
> why would i want an admin script to be xhtml compliant?
You want this so that compliant browsers can display the page. If there was a 101% compliant browser it would reject the page as being invalid ;) > besides surely that's the do as the second parameter in the function definition? As I said, look at adminfunctions.php. > and the reason i would like it is because the form needs to get processed somehow Sure. And where's the problem in processing the form? File demo.php PHP Code:
|
Quote:
|
Quote:
PHP Code:
HTML Code:
<form action="moderate.php?do=WHATEVER" name="confessions" method="post"> basically, am i being told that it's impossible? |
PHP Code:
PHP Code:
HTML Code:
<form action="moderate.php" name="cpform" method="post"> Yes, this is not possible with the standard functions to create CP-forms, although you could do it manually. But as I already said earlier, this is not needed and AFAIK it's not valid at all. |
thanks for your help kirby
|
yay it's all working fine, my only problem now is this
PHP Code:
|
Hmm ... what's the problem with this line (except that it should be & to be XHTML compliant)?
|
lol well basically it should do this in one line
PHP Code:
the query that makes the array is PHP Code:
|
And where do you select a userid and username in your query? I can only see confessionid and text ...
|
it's in the left join :ermm:
|
Nope. You make a join, but you don't select columns from the joined table ;)
If you want username and userid you should do PHP Code:
|
ahhhh you're right such a stupid mistake
thank you so much, i'm so grateful for the help you've given me with this. |
All times are GMT. The time now is 12:57 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|