Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
  #286  
Old 10 May 2010, 16:23
Davidinh Davidinh is offline
 
Join Date: Apr 2005
How to view a item from database
i have create a test page that followed this tutorial
it work fine but i want to connect some item into the database

the test.php

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

the template is exactly as the first post

within data table i dunno how to put (variable of item) into the template page and they will show in the page

any help will be appriciated

also help create the xml file for this test if you guy needed
i create it on local machine therefore i don't have a link
Attached Files
File Type: xml product-vb_test_page.xml (2.7 KB, 8 views)
Reply With Quote
  #287  
Old 10 May 2010, 20:43
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
If your variable name is $categories, then register it for use in the template:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and then use it in the template like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #288  
Old 10 May 2010, 22:10
Davidinh Davidinh is offline
 
Join Date: Apr 2005
thanks Lynne

I tried it but nothing show

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

seem to be not array
Reply With Quote
  #289  
Old 10 May 2010, 22:31
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Well, you never did anything with $categories, so nothing is going to show up from it. You just have an empty while loop (and not even really that).
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #290  
Old 11 May 2010, 01:12
Davidinh Davidinh is offline
 
Join Date: Apr 2005
thanks for reply Lynne but i still dunno what is exactly your point and this is a point i'm not really got it
so, i'm going to put something in while loop like

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and the code line in template
{vb:raw categories.name}
do i have register the varialbe ($name, $des) for template?

--------------- Added 11 May 2010 at 01:20 ---------------

and i tried to register them under $categories :

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

it shows the first letter of the first item in database only
the first item name: testing 1
it shows "t" only

Last edited by Davidinh; 11 May 2010 at 01:20. Reason: Auto-Merged DoublePost
Reply With Quote
  #291  
Old 11 May 2010, 02:58
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
You would have to do something in here if you are in a loop:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I strongly suggest you take a look at some of the code in files like forum.php where there is a while loop.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #292  
Old 11 May 2010, 04:43
EQmandingo EQmandingo is offline
 
Join Date: Oct 2009
i was wondering..... is there a way i can add a forum to display on this custom page say for example the default main forum...or rather just the posts from that forum itself and if so how can i do this.

by the way.. this is by far one of my favorite things i have seen here at vb.org thank you so much.
Reply With Quote
  #293  
Old 11 May 2010, 04:46
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by EQmandingo View Post
i was wondering..... is there a way i can add a forum to display on this custom page say for example the default main forum...or rather just the posts from that forum itself and if so how can i do this.
You would just do a query to grab the threads/posts from that forum and then display them on the page. There is a thread here about this very thing that I answered today. It's out in the main forums, but I posted a basic query in there as an idea of how to do it. (Of course, you can just open up any vB file to see how to do it also.)
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #294  
Old 11 May 2010, 05:05
EQmandingo EQmandingo is offline
 
Join Date: Oct 2009
Originally Posted by Lynne View Post
You would just do a query to grab the threads/posts from that forum and then display them on the page. There is a thread here about this very thing that I answered today. It's out in the main forums, but I posted a basic query in there as an idea of how to do it. (Of course, you can just open up any vB file to see how to do it also.)
WOW!! Could you please link me to said thread and possibly with the post # if its that hot of a thread ... would love to know exactly how to do that the right way.

Btw It is you I am thanking for this thread...I love to try out products but things like this is what helps me understand how to better operate and modify vbulletin. So a proper thank you for this thread and your lightning response to my question :-)
Reply With Quote
  #295  
Old 11 May 2010, 11:54
Davidinh Davidinh is offline
 
Join Date: Apr 2005
thank you Lynne

from the post #291
that mean i have to create more tepmlate as TEST_1 for initial part of category. is it correct Lynne !

i am going to try it and let you know thanks again Lynne

but how about template code

i will use {vb:raw my_output.part of loop}
(part of loop : $ name, $des right !!! or till the same
{vb:raw categories.whatever}
(whatever : name, des )

would you please ...... Lynne

Last edited by Davidinh; 11 May 2010 at 12:02.
Reply With Quote
  #296  
Old 11 May 2010, 15:02
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by EQmandingo View Post
WOW!! Could you please link me to said thread and possibly with the post # if its that hot of a thread ... would love to know exactly how to do that the right way.
All I've posted is some basic info to get started, I did not write the whole page for him - Help calling new threads to a custom page help

Originally Posted by Davidinh View Post
thank you Lynne

from the post #291
that mean i have to create more tepmlate as TEST_1 for initial part of category. is it correct Lynne !

i am going to try it and let you know thanks again Lynne

but how about template code

i will use {vb:raw my_output.part of loop}
(part of loop : $ name, $des right !!! or till the same
{vb:raw categories.whatever}
(whatever : name, des )

would you please ...... Lynne
You need to get the info in order to spit it out. In your original code, you never got the info. You did a query, wrote a while loop to do something with the info from the query, but never actually did anything with it. So, there was nothing to output. Take a look at the forum.php page and how they grab the currently active users. You make a query, then go into a while loop and spit out the user info into a template, then after you get out of the while loop, you spit all that template info out into another template.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #297  
Old 11 May 2010, 16:34
Davidinh Davidinh is offline
 
Join Date: Apr 2005
thanks Lynne
i got it, the way template work on VB4

Once again thanh you very much for your time Lynne
i thought i need one more step about how to use a file CSS or connected it into a template

i am going to create the TEST.css template (with google grids or kind of CSS for 2 or 3 columns) then
on the top (head part) of the main page of cust_page put this link in

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So, it should be completed your tutorial "How create a custom page for VB 4"


thanks for all who distribute this knowlege

Best regard,
Reply With Quote
  #298  
Old 14 May 2010, 14:13
alfanexus alfanexus is offline
 
Join Date: Dec 2008
Would it be possible to put a widget on such a page? If then how?
Reply With Quote
  #299  
Old 14 May 2010, 14:36
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Possible? Almost anything is possible if you code it. I do not know how to put a widget on the page, however, and I imagine it would be a lot more coding that just putting a custom block of your own on the page would be.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #300  
Old 15 May 2010, 17:12
Davidinh Davidinh is offline
 
Join Date: Apr 2005
how to create multiple template under $_REQUEST[do] Lynne

i tried to get more template (on test.php)
but i don't understand how to make a second template for it

any help !
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

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


New To Site? Need Help?

All times are GMT. The time now is 03:51.

Layout Options | Width: Wide Color: