Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-11-2010, 03:19 AM
Satviewers Satviewers is offline
 
Join Date: Oct 2009
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help Please - Overriding a Charset

Hi,

Is there a way to set the Charset to utf-8 on an integrated product and leave the default charset set in the Admincp left alone.
Reply With Quote
  #2  
Old 03-12-2010, 12:43 PM
Satviewers Satviewers is offline
 
Join Date: Oct 2009
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Help please
Reply With Quote
  #3  
Old 03-12-2010, 01:22 PM
borbole's Avatar
borbole borbole is offline
 
Join Date: Jan 2010
Posts: 2,559
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you explain a little bit more please? Do you mean you have a third paty mod integrated with vb and you want its tables to be converted to utf-8 but not the vb ones? If so, yes it can be done.
Reply With Quote
  #4  
Old 03-12-2010, 07:58 PM
Satviewers Satviewers is offline
 
Join Date: Oct 2009
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is an example of what I have.

I created a plugin called oscShop Body.
Hook Location is gobal_start
Code in the plugin is:
PHP Code:
if (THIS_SCRIPT == 'osc_shop')
{
ob_start();
include(
'./packages/shop/index.php');
$includeshopbody ob_get_contents();
ob_end_clean();


My template is oscShop
Code:
PHP Code:
{vb:stylevar htmldoctype}
<
html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
  <
head>
    <
title>{vb:raw vboptions.bbtitle} - {vb:raw pagetitle}</title>

<
meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<
meta id="e_vb_meta_bburl" name="vb_meta_bburl" content="{vb:raw vboptions.bburl}" />
<
base href="{vb:raw vboptions.bburl}/" /><!--[if IE]></base><![endif]-->
<
meta name="generator" content="vBulletin {vb:raw vboptions.templateversion}" />

<
vb:if condition="$show['threadinfo']">

<
vb:elseif condition="$show['foruminfo']" />
        <
meta name="keywords" content="{vb:raw foruminfo.title_clean}, {vb:raw vboptions.keywords}" />
        <
meta name="description" content="<vb:if condition="$pagenumber 1">{vb:rawphrase page_x, {vb:raw pagenumber}}-</vb:if>{vb:raw foruminfo.description_clean}" />
<
vb:else />
        <
meta name="keywords" content="{vb:raw vboptions.keywords}" />
        <
meta name="description" content="{vb:raw vboptions.description}" />
</
vb:if>

<
script type="text/javascript" src="{vb:stylevar yuipath}/yuiloader-dom-event/yuiloader-dom-event.js?v={vb:raw vboptions.simpleversion}"></script>
<
script type="text/javascript" src="{vb:stylevar yuipath}/connection/connection-min.js?v={vb:raw vboptions.simpleversion}"></script>
<
script type="text/javascript">
<!--
    var 
SESSIONURL "{vb:raw session.sessionurl_js}";
    var 
SECURITYTOKEN "{vb:raw bbuserinfo.securitytoken}";
    var 
IMGDIR_MISC "{vb:stylevar imgdir_misc}";
    var 
IMGDIR_BUTTON "{vb:stylevar imgdir_button}";
    var 
vb_disable_ajax parseInt("{vb:raw vboptions.disable_ajax}"10);
    var 
SIMPLEVERSION "{vb:raw vboptions.simpleversion}";
    var 
BBURL "{vb:raw vboptions.bburl}";
// -->
</script>
<
script type="text/javascript" src="{vb:raw vboptions.bburl}/clientscript/vbulletin-core.js?v={vb:raw vboptions.simpleversion}"></script>
{
vb:raw template_hook.headinclude_javascript}

<
vb:if condition="$vboptions['externalrss']">
    <
link rel="alternate" type="application/rss+xml" title="{vb:raw vboptions.bbtitle} {vb:rawphrase rss_feed}" href="{vb:raw vboptions.bburl}/external.php?type=RSS2" />
    <
vb:if condition="$show['foruminfo'] OR $show['threadinfo']">
        <
link rel="alternate" type="application/rss+xml" title="{vb:raw vboptions.bbtitle} - {vb:raw foruminfo.title_clean} - {vb:rawphrase rss_feed}" href="{vb:raw vboptions.bburl}/external.php?type=RSS2&amp;forumids={vb:raw foruminfo.forumid}" />
    </
vb:if>
</
vb:if>

<
vb:if condition="$vboptions['storecssasfile']">
    <
link rel="stylesheet" type="text/css" href="{vb:raw vbcsspath}main-rollup.css" />
        {
vb:raw template_hook.custom_css_links}
<
vb:else />
    <
link rel="stylesheet" type="text/css" href="{vb:raw vbcsspath}bbcode.css,editor.css,popupmenu.css,oscShop_reset-fonts.css,vbulletin.css,vbulletin-chrome.css,vbulletin-formcontrols.css{vb:raw template_hook.custom_css_list}" />
</
vb:if>
{
vb:raw template_hook.headinclude_css}

  </
head>

  <
body>  
    {
vb:raw header}
    
    {
vb:raw navbar}

    {
vb:raw includeshopbody}

    {
vb:raw footer}
  </
body

</
html

My osc_shop.php
PHP Code:
<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
$_shopfile basename($_SERVER['SCRIPT_FILENAME'], '.php');

define('THIS_SCRIPT'$_shopfile);
define('CSRF_PROTECTION'false);  

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array('oscShop',
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
// if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line
// chdir ('/path/to/your/forums');
require_once('./global.php');
require_once(
'./includes/osc_func_var.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits construct_navbits(array('' => 'cart'));
$navbar render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle 'cart';



// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######


$templater vB_Template::create('oscShop');
$templater->register_page_templates();
$templater->register('navbar'$navbar);
$templater->register('pagetitle'$pagetitle);
$templater->register('includeshopbody'$includeshopbody);
print_output($templater->render());


?>

As you can see I have copied the headinclude and modified it and included it in the template above, which also has the charset defined as charset=utf-8.
Reply With Quote
  #5  
Old 03-12-2010, 08:05 PM
borbole's Avatar
borbole borbole is offline
 
Join Date: Jan 2010
Posts: 2,559
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@Satviewers, please don''t pm me for support, but instead use the forums. Thank you for your understanding
Reply With Quote
  #6  
Old 03-12-2010, 08:12 PM
Satviewers Satviewers is offline
 
Join Date: Oct 2009
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry about that
Reply With Quote
  #7  
Old 03-12-2010, 08:16 PM
borbole's Avatar
borbole borbole is offline
 
Join Date: Jan 2010
Posts: 2,559
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem
Reply With Quote
  #8  
Old 03-14-2010, 10:33 PM
Satviewers Satviewers is offline
 
Join Date: Oct 2009
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can anyone help with this please
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:00 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.03838 seconds
  • Memory Usage 2,273KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete