#1 FedericoBiccheddu Lunedì, 25 Febbraio 2008, 15:14
Ecco qui una guida per cambiare il titolo alle pagine personalizzate create con il CMS:
AVVISI:
- Rispettate tutti i caratteri che ho scritto, soprattutto non dimenticatevi il ; alla fine delle linee dove c'è, altrimenti vi restituirà un errore quando visualizzerete la pagina creata!
- Funziona solo se le pagina verranno caricate dal browser con il Nome che gli avete dato, esempio:
- http://www.tuosito.com/nomepagina.php
e non quando vengono caricate con:
- http://www.tuosito.com/index.php?page=ID
Iniziamo:
- Fate un backup dei file che avete creato.
- Aprite la pagina che avete creato, es.: pagina.php.
- Selezionate tutto quello che c'è all'interno e cancellatelo, e incollateci dentro il seguente codice:
<?php
/***************************************************************************
* index_empty.php
* -------------------
* begin : 2007/04/12
* copyright : Mighty Gorgon
* website : http://www.mightygorgon.com
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.' . $phpEx);
if ( !defined('IN_PHPBB') )
{
die('Hacking attempt');
exit;
}
include_once($phpbb_root_path . 'includes/functions_groups.' . $phpEx);
// Start session management
$userdata = session_pagestart($user_ip);
init_userprefs($userdata);
// End session management
/*
$cms_page_id = '0';
$cms_page_name = 'custom_pages';
*/
$auth_level_req = $board_config['auth_view_custom_pages'];
if ($auth_level_req > AUTH_ALL)
{
if ( ($auth_level_req == AUTH_REG) && (!$userdata['session_logged_in']) )
{
message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
}
if ($userdata['user_level'] != ADMIN)
{
if ( $auth_level_req == AUTH_ADMIN )
{
message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
}
if ( ($auth_level_req == AUTH_MOD) && ($userdata['user_level'] != MOD) )
{
message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
}
}
}
//$cms_wide_blocks = ($board_config['wide_blocks_custom_pages'] == 1) ? true : false;
define('PORTAL_INIT', true);
include($phpbb_root_path . 'includes/functions_cms.' . $phpEx);
cms_config_init($cms_config_vars);
$page_filename = mysql_real_escape_string(basename($_SERVER['PHP_SELF']));
$sql = "SELECT * FROM " . CMS_LAYOUT_TABLE . " WHERE filename = '" . $page_filename . "'";
if( !($layout_result = $db->sql_query($sql, false, 'cms_')) )
{
message_die(CRITICAL_ERROR, "Could not query portal layout information", "", __LINE__, __FILE__, $sql);
}
$layout_row = $db->sql_fetchrow($layout_result);
$layout = intval($layout_row['lid']);
$sql = "SELECT template, forum_wide, view, groups FROM " . CMS_LAYOUT_TABLE . " WHERE lid = '" . $layout . "'";
if( !($layout_result = $db->sql_query($sql, false, 'cms_')) )
{
message_die(CRITICAL_ERROR, "Could not query portal layout information", "", __LINE__, __FILE__, $sql);
}
$layout_row = $db->sql_fetchrow($layout_result);
$layout_template = $layout_row['template'];
$cms_wide_blocks = ($layout_row['forum_wide'] == 0) ? false : true;
if ($userdata['user_id'] == ANONYMOUS)
{
$lview = in_array($layout_row['view'], array(0,1));
}
else
{
switch($userdata['user_level'])
{
case USER:
$lview = in_array($layout_row['view'], array(0,2));
break;
case MOD:
$lview = in_array($layout_row['view'], array(0,2,3));
break;
case ADMIN:
$lview = in_array($layout_row['view'], array(0,1,2,3,4));
break;
default:
$lview = in_array($layout_row['view'], array(0));
}
}
$not_group_allowed = false;
if(!empty($layout_row['groups']))
{
$not_group_allowed = true;
$group_content = explode(",",$layout_row['groups']);
for ($i = 0; $i < count($group_content); $i++)
{
if(in_array(intval($group_content[$i]), cms_groups($userdata['user_id'])))
{
$not_group_allowed = false;
}
}
}
if(($layout_template=='') || (!$lview) || ($not_group_allowed))
{
$layout = $cms_config_vars['default_portal'];
$sql = "SELECT template, forum_wide FROM " . CMS_LAYOUT_TABLE . " WHERE lid = '" . $layout . "'";
if( !($layout_result = $db->sql_query($sql, false, 'cms_')) )
{
message_die(CRITICAL_ERROR, "Could not query portal layout information", "", __LINE__, __FILE__, $sql);
}
$layout_row = $db->sql_fetchrow($layout_result);
$layout_template = $layout_row['template'];
$cms_wide_blocks = ($layout_row['forum_wide'] == 0) ? false : true;
}
// Start output of page
$page_title = $board_config['sitename'];
$meta_description = '';
$meta_keywords = '';
//define('SHOW_ONLINE', true);
include($phpbb_root_path . 'includes/page_header.' . $phpEx);
// Tell the template class which template to use.
$template->set_filenames( array( 'body' => 'layout/' . $layout_template ) );
if ( ($userdata['user_level'] == ADMIN) || ($userdata['user_cms_level'] >= CMS_CONTENT_MANAGER))
{
$cms_acp_url = '<br /><br /><div style="text-align:center;">';
$cms_acp_url .= '<a href="' . append_sid('cms.' . $phpEx . '?mode=blocks&l_id=' . $layout) . '">' . $lang['CMS_ACP'] . '</a>';
$cms_acp_url .= '</div>';
}
else
{
$cms_acp_url;
}
// Start Blocks
cms_parse_blocks($layout, false, false, '');
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.' . $phpEx);
?>
- Poi cercare:
$page_title = $board_config['sitename'];
e sovrascrivere con
$page_title = $lang['***']; (al posto di *** inserite il nome che avete dovrete mettere successivamente)
- Salvare e chiudere la pagina.
- Duplicare il file lang_extend_icy_phoenix.php presente nella cartella dei file di lingua (ip_root/languages/lang_***/).
- Rinominare in quello che volete, per esempio: lang_extend_cms_page_title_name.php.
- Cancellate tutto il contenuto lasciando il seguente codice intatto:
<?php
/***************************************************************************
* lang_extend_icy_phoenix.php [Italian]
* -------------------
* begin : 2007/12/03
* copyright : Mighty Gorgon
* version : 1.0.0 (2007/12/03)
* website : http://www.mightygorgon.com
* email : mightygorgon@mightygorgon.com
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
{
die('Hacking attempt');
}
?>
- Aggiungere prima di ?> (cambia *** con quello che avevi scritto nella pagina creata)
Ora se volete potete fare i passaggi numero 6. e 7. nelle altre cartelle delle lingue, poi il passaggio numero 9. traducendo quello che avete scritto come titolo della pagina.
Ringrazio Fucile e hpl per l'input e per l'aiuto  Spero questa guida vi sia utile
Ultima modifica di FedericoBiccheddu il Giovedì, 27 Marzo 2008, 20:31, modificato 1 volta in totale
-

FedericoBiccheddu
-
Veterano

-
- Età: 26
- Registrato: Dicembre 2007
- Residenza: Sant'Antioco
- Messaggi: 2588
-
#2 Andrea75 Martedì, 11 Marzo 2008, 19:36
Inserito nella sezione "GUIDE".
Grazie JC Design.
Versione di IP: 2.0.0.86
Server: Linux
____________ My Icy forum: www.lineameteo.it
Staff Member @ Icy Phoenix.it & Icy Phoenix.com
-

Andrea75
-
Amministratore
 bel tempo con possibili rovesci
-
- Età: 42
- Registrato: Mag 2007
- Residenza: Perugia
- Messaggi: 3984
-
#3 hpl Giovedì, 27 Marzo 2008, 16:13
Devo solamente cercare ora di fare in modo:
- Fare in modo di mettere due titoli che appaiano con le diverse Lingue, se ITA in italiano, se in ENG in inglese.
duplichi il file "lang_extend_icy_phoenix.php" presente nella cartella dei file di lingua rinominandolo in "lang_extend_COMEVUOI.php", lo svuoti completamente e ci scrivi:
$lang['cms_page_test'] = 'Pagina Personale';
Questo lo fai per ogni lingua...
poi nel file "nomepagina.php" dichiari $page_title in questo modo:
$page_title = $lang['cms_page_test'];
prova, non ho testato però forse funziona (i file "lang_extend_*.php" vengono tutti inclusi)
Versione di IP: 1.3.x
Server: Linux
____________
- SoNo un PoMpIeRe -
-

hpl
-
Veterano
 miserable
-
- Età: 37
- Registrato: Mag 2007
- Residenza: Trieste
- Messaggi: 1211
-
#4 hpl Giovedì, 27 Marzo 2008, 18:57
perfetto, ho fatto una piccola modifica al codice perchè mancava il die('Hacking attempt');
se hai tempo e voglia, prova a riunire tutte le informazioni i un unico post (il primo), così facciamo un po' di ordine e pulizia
grazie per il contributo e i test
Versione di IP: 1.3.x
Server: Linux
____________
- SoNo un PoMpIeRe -
-

hpl
-
Veterano
 miserable
-
- Età: 37
- Registrato: Mag 2007
- Residenza: Trieste
- Messaggi: 1211
-
#5 FedericoBiccheddu Giovedì, 27 Marzo 2008, 20:36
Fatto hpl, spero di aver dato un contributo, cmq consiglieri, se possibile, far fare tutto questo automaticamente, cioè, appena si crea una pagina, come codice inserire direttamente quello che viene incluso dal file di /includes/, e dare automaticamente il titolo con il titolo che si da al momento della creazione, proprio il primo campo che si compila  Cmq trovate il tutorial QUI  Se avete problemi postate pure
-

FedericoBiccheddu
-
Veterano

-
- Età: 26
- Registrato: Dicembre 2007
- Residenza: Sant'Antioco
- Messaggi: 2588
-
Questo argomento è stato utile?
Questo argomento è stato utile?
Condividi Argomento |
|
 |
Inserisci un link per questo argomento |
URL |
|
BBCode |
|
HTML |
|
Argomenti Simili
Argomenti Simili
Argomento |
Autore |
Forum |
Risposte |
Ultimo Messaggio |
 |
[RISOLTO] Esportare Le Pagine Create Senza...
|
luke83 |
Archivio 'Supporto Generale' |
7 |
Martedì, 18 Dicembre 2007, 12:52  buldo |
 |
Cambiare Titolo Al Sito...
|
djstato |
Archivio 'Supporto Generale' |
18 |
Giovedì, 07 Febbraio 2008, 14:45  djstato |
 |
Cambiare Titolo Pagina Alla Home
|
FedericoBiccheddu |
Documentazioni e Guide |
3 |
Martedì, 11 Marzo 2008, 19:37  Andrea75 |
 |
Come Cambiare Colore Alle Sezioni.
|
luigi3000 |
Archivio 'Supporto Generale' |
6 |
Giovedì, 09 Ottobre 2008, 13:45  luigi3000 |
 |
Modifiche Alle Pagine Personali Tramite Cms
|
vanzi |
Archivio 'Supporto Generale' |
8 |
Venerdì, 16 Gennaio 2009, 06:26  fucile |
Lista Permessi
|
Non puoi inserire nuovi Argomenti Non puoi rispondere ai Messaggi Non puoi modificare i tuoi Messaggi Non puoi cancellare i tuoi Messaggi Non puoi votare nei Sondaggi Non puoi allegare files Non puoi scaricare gli allegati Non puoi inserire eventi calendario
|
|
|
|
|