PDA

View Full Version : module VBA: add sub title ?


pompaunpo
02-24-2009, 03:08 PM
in VBA template 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

thanks

Dismounted
02-25-2009, 06:44 AM
You need to use the vBulletin Input cleaner to clean your variable(s)!

See the vBulletin Manual (http://www.vbulletin.com/docs/html/codestandards_gpc).

pompaunpo
02-25-2009, 12:03 PM
You need to use the vBulletin Input cleaner to clean your variable(s)!

See the vBulletin Manual (http://www.vbulletin.com/docs/html/codestandards_gpc).


I read the manual and :
https://vborg.vbsupport.ru/showthread.php?t=119372&highlight=%24_GET+clean_gpc( (https://vborg.vbsupport.ru/showthread.php?t=119372&highlight=%24_GET+clean_gpc%28))

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


$vbulletin->input->clean_gpc('g', 'subtitle', TYPE_STR);
$subtitle = htmlspecialchars($vbulletin->GPC['subtitle']);

????? or:
$subtitle = $vbulletin->input->clean_gpc('g', 'subtitle', TYPE_NOCLEAN);


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




--------------- Added 1235584089 at 1235584089 ---------------

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"

Dismounted
02-26-2009, 05:47 AM
$vbulletin->input->clean_gpc('g', 'subtitle', TYPE_NOHTML);
$subtitle = $vbulletin->GPC['subtitle'];