Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #21  
Old 07-04-2004, 09:59 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #22  
Old 07-04-2004, 10:13 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

> 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();

?>
Reply With Quote
  #23  
Old 07-05-2004, 05:19 AM
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Posts: 3,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #24  
Old 07-05-2004, 06:49 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #25  
Old 07-05-2004, 09:05 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #26  
Old 07-05-2004, 03:29 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for your help kirby
Reply With Quote
  #27  
Old 07-05-2004, 04:05 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #28  
Old 07-05-2004, 04:13 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm ... what's the problem with this line (except that it should be &amp; to be XHTML compliant)?
Reply With Quote
  #29  
Old 07-05-2004, 04:23 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)) { 
Reply With Quote
  #30  
Old 07-05-2004, 05:20 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And where do you select a userid and username in your query? I can only see confessionid and text ...
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


All times are GMT. The time now is 07:44 PM.


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.04973 seconds
  • Memory Usage 2,294KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_html
  • (8)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete