![]() |
SOLVED! - starting help, using php <-> templates <-> db
Got the easy part down, find it easy to work in the control panel enviroment,
but displaying, modifying and editing content back and forth from db. But now i want to work with user end app's. I sorta got it narrowed down how to move around inside a php file using do, get and request. almost like cp area. and i got vb styled pages working, using header,footer etc. Let me put up an exsample. i have some content in the db, i want to show a user. the user clicks some botton etc and gets to the point where the content should be shown in the php file,, So my question is how do i get the php file and templates to work together ? i can get content from the db using the php file correct ? and i style the user view with the template correct ? so the datamovement would go like this db-> php file -> template -> user view or am i way off. any articles on this, or suggestions where i can get more info on this specifik topic. ? |
In the php file, you eval the template to get it to show. You might want to look at this article - [How-To] vBulletin API Basics: Creating Custom Pages & Misc. That might help you out some.
|
You may also want to look at the many other articles that could help you.
|
tx lynne, sorta missed that one.
really hard with 0 experience, ;) but i guess only one way to learn :D |
Quote:
|
well okay went through that article, and nothing "new" here.
got all that narrowed down. mypage.php mypage_content (template) Exsample in the db i make a table named .table_prefix."testtable with 2 colums ID(auto,primary) testcontent(text) with the content = ID 1 : line 1 ID 2 : line 2 etc..... ---------------------------here we go the hard part ;) (for me) I want to display display content from the table lwhere id = 2-- i make my sql query etc.. ... but where do i make the query, do i make it inside the template ? or do i make it in the .php file ? i got my table's in the the template but when i try to run a query in the templates it just bugs. i can run querys in the php but cant make it fit into the tables i import/read from the templates.. hehe lol confusing, i hope you know what i mean, and what im trying to achive. i donot have anything to display, just doing alot of test pages, which i usually delete when they mess to much up.. :D EDIT : - Got php pages and creating vb powered pages - Got using the querys in vb - Got using templates. But mixing it together.. ehhh.. im lost. :D |
Queries go in the php page - mypage.php - before you eval the template.
|
Quote:
eksample i then do a query ----------template page--------- <table...... .....some content, phrases... . etc <tr> <td>$test</td></tr> </tr> </table> ------------------------------------ ? ? ? -----------php page----- $test = querystring........ eval template ---------------------------- did i understand it correctly ? ;) EDIT ADD : saw this post https://vborg.vbsupport.ru/showthread.php?t=205362 and think i got it right time for some tests. |
I wrote a fairly simple mod that does a query and then spits out some stuff on vb like page. It has two templates with it. You may want to take a look at it. It's here - View all your social group messages. It may help you with figuring out how to do what you want.
|
1 Attachment(s)
ahh yes, then i got it right..
then its the evel thats bugging me... Php page named "Test.php" in forumroot PHP Code:
Code:
$stylevar[htmldoctype] Attachment 94884 when using Print output eval works fine, when using $testmessage just says error at random lines in eval()_line x this is my only current barrier for some modding :D ---- EDIT found the ) and replaced with ; in the end of Eval line, howewer instead of an error a blank page? wth.. :p |
All times are GMT. The time now is 08:56 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|