vb.org Archive

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

Ipuck 09-04-2006 04:44 AM

Custom Page
 
Hello

I'm making a custom page for my site using this:

https://vborg.vbsupport.ru/showthread.php?t=62164

In my .php page I have a function that gets the username and returns some result from a database.

When I link to the user page I used:

http://...../mypage.php?username=$bbuserinfo[username]

That link works perfect, the user gets his information with no problem.

But if the user reaches the page directly.

http://...../mypage.php

Then the user gets the first rows from the database.

In my .php page I have a function like this:

Quote:


$vbulletin->input->clean_array_gpc('r', array(
'username'=> TYPE_STR
));

$username = $vbulletin->GPC['username'];

$strSQL = "
SELECT * FROM table
WHERE user_name LIKE '%".$username."%'
";
$result = $vbulletin->db->query_read($strSQL);

if ($vbulletin->db->num_rows($result) == 0) {
$output .= 'No Record!';

} else {
while ($row = $vbulletin->db->fetch_array($result)) {
'
'if
'//query will read only three rows
'
'if
'
}

?>
How can I read the username and then run the query? I think the problem is the the page is displaying the information before it reads who is the user in the page.

Thanks you!

Brandon Sheley 09-04-2006 05:03 AM

why not use this ?
https://vborg.vbsupport.ru/showthread.php?t=103076
it's the best IMO

Ipuck 09-04-2006 05:10 AM

Thank you Loco!

Unfortunately there is no much support for webtemplates. I tried that already and the creator said that he wasn't going to support the hack anymore. Also I can name my page

www.mysite.com/mypage

with webtemplated is

www.mysite.com/forums/view.php?=mypage

Ipuck 09-06-2006 02:59 AM

Any one?

Help Please!!


All times are GMT. The time now is 12:59 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.00965 seconds
  • Memory Usage 1,717KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete