Seite 1 von 4

Neue Seite einbauen. Fragen.

Verfasst: 31.01.2008 21:48
von User-Einer
Ich möchte gerne eine neue Seite einbauen. Aber so einfach wie es scheint ist es nicht.

1. Die neue Seite ist nicht ganz Fehlerfrei. Zum Beispiel ist die Uhrzeit und das Datum links anstatt rechts und auf Englisch.

2. Ich weiss nicht wo "mein Inhalt" genau hin soll.

Also...

Ich ertstelle eine Datei namens Imressum.php

Code: Alles auswählen

<?php
/**
*
* @author Original Author Username author_email@domain.tld - http://mywebsite.tld
* @author Another Author Username another_email@domain.tld - http://domain.tld
*
* @package {PACKAGENAME}
* @version $Id$
* @copyright (c) 2007 Your Group Name
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
define('IN_PHPBB', true);
// Specify the path to you phpBB3 installation directory.
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
// The common.php file is required.
include($phpbb_root_path . 'common.' . $phpEx);

// since we are grabbing the user avatar, the function is inside the functions_display.php file since RC7
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);

// specify styles and/or localisation
// in this example, we specify that we will be using the file: my_language_file.php
$user->setup('mods/my_language_file');

/*
* All of your coding will be here, setting up vars, database selects, inserts, etc...
*
* This is a very primitive example, it’s meant to show you a working example only.
*/
$example_variable = sprintf($user->lang['TIME_NOW'], $user->format_date(time()));
$google_logo = '<a href="http://www.google.com/"><img src="http://www.google.com/intl/en_ALL/images/logo.gif" alt="Google" /></a>';

// A typical usage for sending your variables to your template.
$template->assign_vars(array(
    'EXAMPLE_VAR'    => $example_variable,
    'GOOGLE_LOGO'    => $google_logo,
    'MY_AVATAR'        => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
));

/*
 * assigning some static example data to an array.
 * all language strings would normally be included in the language file,
 * this is meant for demonstration purposes ONLY.
 */
$some_array = array(
    array(
        'example'        => 'Just an Example 1',
        'demonstration'    => 'Somecount',
    ),
    array(
        'example'        => 'Just an Example 2',
        'demonstration'    => 'Somecount again',
    ),
);

/*
 * basic example of the assign block vars for the templates
 * This basically will allow you to easily display a block or array of data in a template
 * this is useful for items such as SQL queries to the database and displaying them in your templates.
 */
foreach ($some_array as $row)
{
    $template->assign_block_vars('block_name', array(
        'EXAMPLE'        => $row['example'],
        'DEMO'            => $row['demonstration'],
    ));
}

// Page title, this language variable should be defined in the language file you setup at the top of this page.
page_header($user->lang['MY_TITLE']);

// Set the filename of the template you want to use for this file.
// This is the name of our template file located in /styles/<style>/templates/.
$template->set_filenames(array(
    'body' => 'my_template.html',
));

// Completing the script and displaying the page.
page_footer();

?>
Was ist hier was? ich mchte keine Google sachen usw. Nur eine reine leere Seite. Wo kommt mein [Text] hin???

Nun erstelle ich eine Seite namens my_language_file.php

Code: Alles auswählen

<?php
/**
*
* groups [English]
*
* @author My Username email@domain.tld - http://website.tld
*
* @package language
* @version $Id$
* @copyright (c) 2007 Your Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
    exit;
}

if (empty($lang) || !is_array($lang))
{
    $lang = array();
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine

$lang = array_merge($lang, array(
    'EXAMPLE'        => 'Example',
    'DEMO'            => 'Demo',
    'TIME_NOW'        => 'The time right now is %s',
    'MY_TITLE'        => 'My New Page Title',
));

?>
Muss ich hier was ändern damit das datum usw auf der rechten seite ist? und auf deutsch?

nun erstelle ich noch die 3. datei namens my_template.html

Code: Alles auswählen

<!-- INCLUDE overall_header.html -->

<div>{MY_AVATAR}</div>
<div>{EXAMPLE_VAR}</div>
<div>{GOOGLE_LOGO}</div>

<table class="table1" cellspacing="1">
    <tr>
        <th>{L_EXAMPLE}</th>
        <th>{L_DEMO}</th>
    </tr>
    <!-- BEGIN block_name -->
    <tr class="<!-- IF block_name.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
        <td>{block_name.EXAMPLE}</td>
        <td>{block_name.DEMO}</td>
    </tr>
    <!-- END block_name -->
</table>

<!-- INCLUDE overall_footer.html -->
hier muss ich wohl nichts ändern oder???


Kann mir jemand genau sagen was ich machen muss damit...

1. die seite wirklich leer ist.
2. das datum und die uhrzeit rechts ist und auf deutsch.


Ich wäre sehr glücklich wenn mir jemand sagen würde was icg ganz genau machen muss. die neue seite soll www.XXX.de/Impressum heissen.

ich habe zwar noch fragen wie ich das machen kann das nur registrirte auf die neue seite gucken können und so aber das machen wir besser später. :)

Verfasst: 01.02.2008 02:06
von User-Einer
Ich habe mir mal selber geholfen und bin dabei auf ein Problem gestoßen.

Wenn ich "meinen Text" einbaue, passiert es manchmal das zeichen wie öäü als fragezeichen angezeigt werden. erst war es nicht so aber nun schon und egal was ich mache es geht nicht weg.

Verfasst: 01.02.2008 02:23
von djchrisnet
vielleicht währe der folgende Mod ja nicht viel einfacher für dich, wozu das Rad immer neu erfinden?

http://www.phpbb.de/viewtopic.php?t=149651

Verfasst: 01.02.2008 02:26
von User-Einer
Ne... ;)

ich möchte ja noch viele andere Seiten erstellen... :)

Also nun habe ich das ÖÜÄ Problem umgangen aber dafür sind die schriften vom header usw dicker geworden... :-?

Verfasst: 01.02.2008 03:35
von djchrisnet
ohne meine Glaskugel kann ich dir leider nicht helfen.... Haste vll mal nen Link zu der seite?

Verfasst: 01.02.2008 03:43
von User-Einer
Habe das Problem auch selber behoben. ;)

ü = &uuml;

Nur finde ich es voll hässlich das texte die untereinander stehen...

beispiel:
Hallo das ist nur ein Beispiel.
Dieser Text ist zu NAHE am oberen Text dran.
Warum weiss ich auch nicht

Verfasst: 01.02.2008 08:54
von Dr.Death
@ User-Einer:

KB:166

Wenn Du das beachtest, kannst ( und sollst Du sogar ) normale Umlaute in Deine Sprachdateien schreiben.

Der Hinweis auf UTF8 ohne BOM steht bereits in der Sprachdatei:
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.

Verfasst: 01.02.2008 09:34
von User-Einer
Hallo. :)

Ich verzichte komplett auf language dateien und so. ok ok ich habekeine uhr und kein datum aber dafür schaut es jetzt so aus wie ich es gerne wollte. :) ein bisschen umstänldich aber egal...

spricht doch nichts dagegen oder?

Verfasst: 01.02.2008 10:35
von Helmut
Hallo User-Einer,

an deiner Stelle würde ich auf alle Fälle mit Sprachdateien arbeiten, vorallem dann wenn du noch viele Seiten dazu machen willst.

Ich bin auch gerade dabei, meine HP neu zu machen, bei mir sind es mehrere hundert Seiten. Da ist es nur logisch wenn man es mit Sprachdateien macht, vor allem dann wenn man irgendwann mal seine Seiten in einer anderen/weiteren Sprache anbieten möchte.

Klar kannst du den Textinhalt deiner Seiten auch direkt in die jeweilige Datei geben, bist aber dann sehr unflexibel wenn es um Änderungen (weitere Sprache, .....) geht.

Gruß Helmut :wink:

Verfasst: 01.02.2008 16:04
von User-Einer
Wie kriege ich das hin das nur bestimmte gruppen auf die neue seite dürfen???

1. Zugang nur für registrierte.

2. Zugang nür für admins.

3. zuganz nur für admins und mods.

3. zuganz nur für eine bestimmte gruppe (premium user) und admins und mods.

Wie kann ich das machen?

ich antowrt und hilfe würde ich mich sehr freuen.