vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   moderate.php (https://vborg.vbsupport.ru/showthread.php?t=65937)

sabret00the 07-04-2004 09:59 PM

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.

Andreas 07-04-2004 10:13 PM

> 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:

<?php
error_reporting
(E_ALL & ~E_NOTICE);

define('NO_REGISTER_GLOBALS'1);

$phrasegroups = array();
$specialtemplates = array();

require_once(
'./global.php');

print_cp_header('AdminCP Demo');

if (!
$_REQUEST['do']) {
  
$_REQUEST['do'] = 'showform';
}

if (
$_REQUEST['do'] == 'showform') {
print_form_header('demo''processform');
print_table_header('Some foobar form');
print_input_row("Name","name","",0,50);
print_submit_row();
}

if (
$_REQUEST['do'] == 'processform') {
  
print_cp_message("Hello $_REQUEST[name]");
}

print_cp_footer();

?>


assassingod 07-05-2004 05:19 AM

Quote:

Originally Posted by KirbyDE
@assassingod
Nope. The 1st parameter should be the filename (without .php) and the 2nd should be the action.

Oops, thanks for correcting me:)

sabret00the 07-05-2004 06:49 AM

Quote:

Originally Posted by KirbyDE
> 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:

 <?php
 error_reporting
(E_ALL & ~E_NOTICE);
 
 
define('NO_REGISTER_GLOBALS'1);
 
 
$phrasegroups = array();
 
$specialtemplates = array();
 
 require_once(
'./global.php');
 
 
print_cp_header('AdminCP Demo');
 
 if (!
$_REQUEST['do']) {
   
$_REQUEST['do'] = 'showform';
 }
 
 if (
$_REQUEST['do'] == 'showform') {
 
print_form_header('demo''processform');
 
print_table_header('Some foobar form');
 
print_input_row("Name","name","",0,50);
 
print_submit_row();
 }
 
 if (
$_REQUEST['do'] == 'processform') {
   
print_cp_message("Hello $_REQUEST[name]");
 }
 
 
print_cp_footer();
 
 
?>


sorry kirby i seem to be annoying you but unless i'm reading something wrong

PHP Code:

function print_form_header($phpscript ''$do ''$uploadform false$addtable true$name 'cpform'$width '90%'$target ''$echobr true$method 'post'

which would be the same as?
HTML Code:

<form action="moderate.php?do=WHATEVER" name="confessions" method="post">
arghh i'm confusing myself it's too early.

basically, am i being told that it's impossible?

Andreas 07-05-2004 09:05 AM

PHP Code:

function print_form_header($phpscript ''$do ''$uploadform false$addtable true$name 'cpform'$width '90%'$target ''$echobr true$method 'post'

when called as
PHP Code:

print_form_header('moderate''doconfessions'); 

generates

HTML Code:

<form action="moderate.php" name="cpform" method="post">
...
<input type="hidden" name="do" value="doconfessions" />
</form>

> basically, am i being told that it's impossible?
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.

sabret00the 07-05-2004 03:29 PM

thanks for your help kirby

sabret00the 07-05-2004 04:05 PM

yay it's all working fine, my only problem now is this

PHP Code:

 print_label_row('<b> Posted: By </b>'iif($confession['userid'], "<a href=\"user.php?$session[sessionurl]do=viewuser&userid=$confession[userid]\" target=\"_blank\">$confession[username]</a>""Anonymous")); 

well on that script anyway

Andreas 07-05-2004 04:13 PM

Hmm ... what's the problem with this line (except that it should be &amp; to be XHTML compliant)?

sabret00the 07-05-2004 04:23 PM

lol well basically it should do this in one line

PHP Code:

if ($confession['userid']) {
 echo(
'<a href=\"user.php?$session[sessionurl]do=viewuser&userid=$confession[userid]\" target=\"_blank\">$confession[username]</a>');
 } else {
 echo(
'Anonymous');
 } 

but all that's showing up is anonymous everytime

the query that makes the array is
PHP Code:

        $confessions=$DB_site->query("
             SELECT confessions.confessionid, confessions.text 
             FROM " 
TABLE_PREFIX "confessions
             LEFT JOIN user ON (user.userid = confessions.userid)
             WHERE visible=0
 
         while (
$confession=$DB_site->fetch_array($confessions)) { 


Andreas 07-05-2004 05:20 PM

And where do you select a userid and username in your query? I can only see confessionid and text ...


All times are GMT. The time now is 06:34 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
  • Page Generation 0.01537 seconds
  • Memory Usage 1,775KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (8)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete