Chcę zrobić podstronę linki

Forum przeznaczone dla osób poszukujących modyfikacji do phpBB 3.0.x oraz ich polskich lokalizacji.
jump0ncash
Posty: 31
Rejestracja: 21 listopada 2009, 18:58
Kontakt:

Chcę zrobić podstronę linki

Post autor: jump0ncash » 27 grudnia 2009, 15:41

Witam,

Chcę zrobić dodatkową podstronę np. o nazwie linki. Jak moge to zrobić najprościej?

Najlepiej żeby w body strony nie było listy for tylko linki...

Awatar użytkownika
NoVi
Posty: 151
Rejestracja: 16 maja 2005, 14:56
Lokalizacja: Czeladź
Kontakt:

Re: Chcę zrobić podstronę linki

Post autor: NoVi » 27 grudnia 2009, 16:00

Musisz stworzyć 3 pliki.

1.
linki.php

Kod: Zaznacz cały

<?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 : './';
$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: sms.php
$user->setup('mods/sms');

/*
* 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' => 'sms.html',
));

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

?>
Wgrywasz ją do głównego katalogu forum

Następnie plik
linki.php

Kod: Zaznacz cały

<?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'        => 'Linki',
));

?>
wgrywasz go do language/pl/mods/

I jeszcze plik stylu czyli:
linki.html

Kod: Zaznacz cały

<!-- INCLUDE overall_header.html -->
<br />
<table  width="100%" height="28" border="0"  cellspacing="0">
<tr>
<td class="uperimg"><img src="{T_THEME_PATH}/images/cellpic4_l.png" width="17" height="28" alt="" /></td>
			<td   background="{T_THEME_PATH}/images/cellpic4_m.png" class="cat" colspan="3" width="100%" height="28"><h4><center>Twoj tekst</center></h4></td>
		 
			<td  class="uperimg"><img src="{T_THEME_PATH}/images/cellpic4_r.png" width="16" height="28" alt="" /></td>
		</tr>
			 </table>
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"> 
<th class="thHead" colspan="3" width="100%" nowrap="nowrap">Twoj tekst</th>
<tr>
<td class="row1">
<font face=Tahoma size=2>Twoj tekst
</font>

</td>

</tr></table>


<!-- INCLUDE overall_footer.html -->
Wgrywasz do katalogu styles/twój styl/template/

I żeby edytować sobie wyświetlane napisy itp edytujesz tylko plik linki.html
Ja z tego sposobu korzystam i myśle że własnie o to ci chodziło.

jump0ncash
Posty: 31
Rejestracja: 21 listopada 2009, 18:58
Kontakt:

Re: Chcę zrobić podstronę linki

Post autor: jump0ncash » 27 grudnia 2009, 16:30

masz jakąś modyfikacje ktora wywala mi blad sms.php nieiwem co to jest

Awatar użytkownika
@Marcin
Zasłużony
Posty: 1635
Rejestracja: 08 lutego 2009, 21:27
Lokalizacja: Nowa Ruda (PL) / Milton Keynes (UK)
Kontakt:

Re: Chcę zrobić podstronę linki

Post autor: @Marcin » 27 grudnia 2009, 17:11

wywal to

Kod: Zaznacz cały

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

jump0ncash
Posty: 31
Rejestracja: 21 listopada 2009, 18:58
Kontakt:

Re: Chcę zrobić podstronę linki

Post autor: jump0ncash » 27 grudnia 2009, 17:43

Nie dziala nadal

Awatar użytkownika
@Marcin
Zasłużony
Posty: 1635
Rejestracja: 08 lutego 2009, 21:27
Lokalizacja: Nowa Ruda (PL) / Milton Keynes (UK)
Kontakt:

Re: Chcę zrobić podstronę linki

Post autor: @Marcin » 27 grudnia 2009, 20:06

wywal

Kod: Zaznacz cały

$template->set_filenames(array(
    'body' => 'sms.html',
)); 
jeśli nadal bedzie wywalało błąd to wklej go tu na forum
Wsparcie phpBB PL !!

Awatar użytkownika
NoVi
Posty: 151
Rejestracja: 16 maja 2005, 14:56
Lokalizacja: Czeladź
Kontakt:

Re: Chcę zrobić podstronę linki

Post autor: NoVi » 27 grudnia 2009, 23:14

wywal to co podał Marcin albo zamiast sms zmień na linki

Awatar użytkownika
Grin
Posty: 117
Rejestracja: 01 marca 2009, 09:49
Lokalizacja: Puławy
Kontakt:

Re: Chcę zrobić podstronę linki

Post autor: Grin » 28 grudnia 2009, 09:48

Profesjonalne usługi phpBB3 - www.w-zielinski.pl :)

Zablokowany

Wróć do „Poszukiwania”