![]() |
create link to a forum using "title_clean" as tag?
hi, i'm new to vbull, new to php.... :(
i am trying to define links to forums using title_clean as the identifier. (i believe this to be the only aplha unique field within table). can anyone please point me in the right direction... more info... what i really want is a link to a forum which coresponds to a specific vbad page. the idea being that the vbad page is the "entry point" for visitor, which then has a link to forum which coresponds to that page. i have created tables in mysql which have identical values for "pageid" and "title_clean". thanx in advance jfk --------------- Added [DATE]1210668489[/DATE] at [TIME]1210668489[/TIME] --------------- here is an example of what i trying to achieve... tho not correct!... the link must be defined by a variable (to enable multiple entries into db) $url/forums/forumdisplay.php?f=$foruminfo[title_clean=pageid] ... (title_clean and pageid have identical values in the db) or something like this :confused: |
i see a lot of views to my post, but no replies :( which probably means i'm not asking the correct question.
here is what i want to do. i have created a list of vb_adv pages. i have created a list of vbul forums. both pages and forums are from the same list. i want to make a link from the "page" to the corresponding "forum" (and vice-versa) using $variable. i know which data i want to look up, but my problem is that i dont know the syntax. i would like vbull to look at the page it is currently displaying, using whatever $variable it used to create that page eg. sql_table "adv_pages"- field "title", then take this piece of data and go look in sql_table "forum"- field "title_clean", compare the data and return a match which then displays the relative forum. i guess i've made this a complicated question again :( .... sorry. |
I think the best anyone can offer you is the following:
Use the following conditional in your forumdisplay template: Code:
<if condition="$forumid == X">Your ad here</if> Code:
<if condition="in_array($forumid, array(X,Y,Z))">Your ad here</if> More conditionals: http://www.vbulletin.com/forum/showthread.php?t=200894 |
hello again, i'm back! :)
i am sure there are a number of ppl here who can solve this problem for me, if i can just attract their attention for a few mins. i am half way through my second year of vbull license, and still dont have a working forum. this must be a record! :) i am member of vbulletin (obviously), vbulletin.org, vbadvanced, and vbulletinsetup, and somehow i can't seem to ask the right question.... to get the right answer. i will try a different tack here, again! :) essentially, i want to "query the sql database". how hard can that be, u might ask? all over the world, vbull scripts must be "querying the database" a million times a second! :) the whole script "survives" on "querying the database". this is precisely why i have opted for vbull, BECAUSE it uses mysql! i am getting a little despondent, at this stage. i should by this time, be an expert in PHP, MYSQL, and any number of programming langs! :) ok, enough of waffle. why does this not work? Code:
$get_forumid = $db->query("SELECT forumid FROM " . TABLE_PREFIX . "forum WHERE title LIKE '$getpage'"); Code:
<a href="http://mysite.com/forums/forumdisplay.php?f="$get_forumid"> |
You probably want to use $db->query_first() instead of $db->query().
also make sure that $getpage is cleaned before using it in the query. |
Quote:
--------------- Added [DATE]1224954048[/DATE] at [TIME]1224954048[/TIME] --------------- here is an of what i have tried so far: here's where i up to.... inserted query here (in vba_cmps_include_top.php) Code:
// Figure out which page to grab then i have inserted this link here (in navbar template) Code:
<!-- nav buttons bar --> |
PHP Code:
|
Quote:
|
What is the value of $get_forumid after the database call?
|
Quote:
the "real" expected value would be as follows: if i submit (to db) a $pagetitle var which= "Stockport", for example... the query will find a forum which also has a "title" of Stockport, and this would have a "forumid" value of "395". (this is the actual entry in the db) |
All times are GMT. The time now is 09:15 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|