Strona 1 z 1
Jak zrobić łącznie posty tematy i inne proszę o pomoc !!
: 31 maja 2010, 11:55
autor: aleks365
Witam serdecznie
Chciałem zrobić coś takiego Liczba postów X liczba tematów Y Liczba użytkowników V i najnowszy użytkownik Z
chciałem to mieć na głównej stronie mojej strony www bo na forum jest ale chciałem sobie to zrobić na głównej stronie ale nie wiem jak próbowałem ale nie dałem rady proszę o pomoc najlepiej już gotowe niech ktoś mi zrobi a wersje forum mam phpbb 3.0.5
Re: Jak zrobić łącznie posty tematy i inne proszę o pomoc !!
: 31 maja 2010, 22:28
autor: pit
http://www.phpbb.com/kb/article/add-a-n ... -to-phpbb/
demo
test.php
Kod: Zaznacz cały
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('common');
// Set some stats, get posts count from forums data if we... hum... retrieve all forums data
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];
$total_users = $config['num_users'];
$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';
// Assign index specific vars
$template->assign_vars(array(
'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),
'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics),
'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users),
'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '')
);
page_header('Test');
$template->set_filenames(array(
'body' => 'test.html',
));
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>
test.html
Kod: Zaznacz cały
<!-- INCLUDE overall_header_test.html -->
<img style="display: block; margin: 10px auto;" src="images/under_construction.jpg" />
<div class="forumbg">
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="stat">
<li class="stat">
<h3>{L_STATISTICS}</h3>
<p>{TOTAL_POSTS} • {TOTAL_TOPICS} • {TOTAL_USERS} • {NEWEST_USER}</p>
<p>{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{LOGGED_IN_USER_LIST}
</li>
</ul>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- INCLUDE overall_footer_test.html -->
Re: Jak zrobić łącznie posty tematy i inne proszę o pomoc !!
: 07 czerwca 2010, 22:35
autor: aleks365
Czemu to nie działa może inną wersje do innego forum bo ja mam ver 3.0.5 i coś nie działa to co mam zrobić ??
Re: Jak zrobić łącznie posty tematy i inne proszę o pomoc !!
: 09 czerwca 2010, 18:24
autor: pit
Czemu to nie działa
Jak nie działa skoro widzę jak działa.
Re: Jak zrobić łącznie posty tematy i inne proszę o pomoc !!
: 11 czerwca 2010, 21:13
autor: aleks365
no nie działa mi powiec gdzie co mam dać może coś źle robię
Re: Jak zrobić łącznie posty tematy i inne proszę o pomoc !!
: 11 czerwca 2010, 22:41
autor: pit
To
Kod: Zaznacz cały
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('common');
// Set some stats, get posts count from forums data if we... hum... retrieve all forums data
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];
$total_users = $config['num_users'];
$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';
// Assign index specific vars
$template->assign_vars(array(
'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),
'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics),
'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users),
'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '')
);
page_header('Test');
$template->set_filenames(array(
'body' => 'test.html',
));
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>
dajesz do głównego katalogu domeny pod nazwą "test.php"
to
Kod: Zaznacz cały
<!-- INCLUDE overall_header.html -->
<img style="display: block; margin: 10px auto;" src="http://sesprites.herobo.com/images/under_construction.jpg" />
<div class="forumbg">
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="stat">
<li class="stat">
<h3>{L_STATISTICS}</h3>
<p>{TOTAL_POSTS} • {TOTAL_TOPICS} • {TOTAL_USERS} • {NEWEST_USER}</p>
<p>{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{LOGGED_IN_USER_LIST}
</li>
</ul>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- INCLUDE overall_footer.html -->
do "template" pod nazwą "test.html".
Adres "domena/test.php"
Re: Jak zrobić łącznie posty tematy i inne proszę o pomoc !!
: 12 czerwca 2010, 12:35
autor: aleks365
No nie działa piszę
Kod: Zaznacz cały
Warning: main() [function.main]: Unable to access ./common.php in /var/www/sites/yoyo.pl/l/i/live-for-speed/test.php on line 5
Warning: main(./common.php) [function.main]: failed to open stream: No such file or directory in /var/www/sites/yoyo.pl/l/i/live-for-speed/test.php on line 5
Warning: main() [function.include]: Failed opening './common.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/sites/yoyo.pl/l/i/live-for-speed/test.php on line 5
Fatal error: Call to a member function on a non-object in /var/www/sites/yoyo.pl/l/i/live-for-speed/test.php on line 8
Re: Jak zrobić łącznie posty tematy i inne proszę o pomoc !!
: 12 czerwca 2010, 17:40
autor: pit
Jeszcze raz - "test.php" tam gdzie masz "config.php" - "test.html" do LFS_Style/template.
Re: Jak zrobić łącznie posty tematy i inne proszę o pomoc !!
: 13 czerwca 2010, 15:20
autor: aleks365
Dobra działa już coś źle zrobiłem ale chciałem tylko
Liczba postów: x
Liczba tematów: x
Liczba użytkowników: x
Najnowszy użytkownik: x
i chciałem to mieć w tabeli na głównej stronie nie na forum
Tak ja na tej stronie
http://www.lf2-planeta.yoyo.pl/ po lewej kawałek na dole i takie coś bym bardzo chciał
Re: Jak zrobić łącznie posty tematy i inne proszę o pomoc !!
: 13 czerwca 2010, 19:01
autor: pit