PDA

View Full Version : module SUB-TITLE ?


pompaunpo
02-24-2009, 06:48 AM
in adv_portal i have:

<title>$vboptions[hometitle] <if condition="$pagetitle">- $pagetitle</if></title>

$pagetitle is the variable "title name" that I set in my module.

my module name is "book" and I see it as:
www.mysite.com/index.php?id_page=book&nr=22
my php module "book" executes a query to the database and shows the data es: book nr.22
In the page <TITLE> tag there is: "My site name - book"
"book" is $pagetitle, definite in the Admin CP module, OK?

how do I do to add in page module also the title of the book nr.22? es.
title book nr. 22 is "THE LAST HISTORY"

I would want the title of the page to be: "My site name - book - THE LAST HISTORY"

I could pass in GET variable es:
www.mysite.com/index.php?id_page=book&nr=22&subtitle=THE LAST HISTORY

how do I do to make to recognize the variable $subtitle?
in adv_portal i have add:
<title>$vboptions[hometitle] <if condition="$pagetitle">- $pagetitle</if>
<if condition="$subtitle">- $subtitle</if>
</title>

but doesn't work, I now see "My site name - book - " instead that "My site name - book"

in my php module I have add

$subtitle= $_GET['subtitle'];

but doesn't work

help me please and excuse me for my english

thanks

pompaunpo
02-25-2009, 11:24 AM
I read:
http://www.vbulletin.org/forum/showthread.php?t=119372&highlight=%24_GET+clean_gpc()

but I did not understand how use vBulletin Input cleaner in my example $subtitle= $_GET['subtitle'];

I have done this plugin

<?xml version="1.0" encoding="ISO-8859-1"?>
<plugins>
<plugin active="1" executionorder="5" product="vbulletin">
<title>Add subtitle my module book</title>
<hookname>Add_subtitle</hookname>
<phpcode><![CDATA[if (@$_GET['subtitle']){
$subtitle = $vbulletin->input->clean_gpc('g', 'subtitle', TYPE_NOHTML);
}]]></phpcode>
</plugin>
</plugins>

and in VBA template adv_portal

<title>$vboptions[hometitle] <if condition="$pagetitle">- $pagetitle</if>
<if condition="$subtitle">- $subtitle</if>
</title>
but not work !

you can give me an example please?

thanks

Our Sponsors
 

pompaunpo
02-25-2009, 12:48 PM
wow! now it works !
this is my plugin


<?xml version="1.0" encoding="ISO-8859-1"?>
<plugins>
<plugin active="1" executionorder="5" product="vBadvanced CMPS">
<title>Add subtitle my module book</title>
<hookname>vba_cmps_print_output</hookname>
<phpcode><![CDATA[
if (@$_GET['subtitle']){
$subclear = @$_GET['subtitle'];
$subtitle = $vbulletin->input->clean($subclear, TYPE_NOHTML);
}]]></phpcode>
</plugin>
</plugins>



product="vBadvanced CMPS"
location hook = "vba_cmps_print_output"


---------------

even if no one helped me there I report my solution