vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   module VBA: add sub title ? (https://vborg.vbsupport.ru/showthread.php?t=206474)

pompaunpo 02-24-2009 03:08 PM

module VBA: add sub title ?
 
in VBA template adv_portal i have:

Code:

<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:
Code:

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:
Code:

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:
Code:

<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

Code:

$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.

pompaunpo 02-25-2009 12:03 PM

Quote:

Originally Posted by Dismounted (Post 1753992)
You need to use the vBulletin Input cleaner to clean your variable(s)!

See the vBulletin Manual.


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

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
Code:

<?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
Code:

<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 [DATE]1235584089[/DATE] at [TIME]1235584089[/TIME] ---------------

wow! now it works !
this is my plugin

Code:

<?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

PHP Code:

$vbulletin->input->clean_gpc('g''subtitle'TYPE_NOHTML);
$subtitle $vbulletin->GPC['subtitle']; 



All times are GMT. The time now is 05:48 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
  • Page Generation 0.01191 seconds
  • Memory Usage 1,730KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete