Portal - [Problem] Jak wyciągnąć czytaj całość
LCA:) - 04-02-2015, 00:08 Temat postu: [Problem] Jak wyciągnąć czytaj całość Jak wyciągnąć z kodu który podałem poniżej "Czytaj całość" aktualne czytaj całość się nie sprawdza gdyż jak dodaje jakiś odnośnik artykułu (Artykuł dodaje na forum pisząc temat) np Media o nas portal.php?article=0&start=0
to w momencie kiedy dodam nowego newsa pod odnośnikiem media o nas znajduje się całkowicie coś innego np kontakt
Jak coś ten kod posiadam z przemoNews v2.1 http://www.przemo.org/php...pic.php?t=70361
Adres Strony: http://mathe.ct8.pl
Demo Przemo_News 2.1: http://mathe.ct8.pl/przemo_news2.1/
Oczywiście mam nadzieje że ten kod który podałem niżej wystarczy aby działało to poprawnie na forum
Kod: |
<?php
######################################################################
## przemoNEWS - autor skryptu: bucu <bucu666@gmail.com> ##
## <www.backbone.neth.pl> ##
## ##
## Pomoc techniczna dla skryptu na forach: ##
## www.przemo.org/phpBB2 i www.unmods.pl ##
## ##
## Podziękowania dla użytkowników forum przemo.org, ##
## w szczególności: "Maminowiec", "Lui754", "Mikael". ##
## ##
## Usuwanie kodu stopki jest złamaniem warunków licencji i skutkuje ##
## brakiem pomocy technicznej w razie problemów ze skryptem. ##
######################################################################
error_reporting(E_ALL ^ E_NOTICE);
include('template.php');
switch($_GET['mode'])
{
default:
case 'default';
$sql = 'SELECT t.topic_id, t.topic_time, t.topic_title, pt.post_text, u.username, u.user_id, u.user_rank, u.user_posts,
t.topic_replies, pt.bbcode_uid, t.forum_id, t.topic_poster, t.topic_first_post_id, t.topic_status, pt.post_id,
p.post_id, p.post_time, p.enable_smilies FROM ' . TOPICS_TABLE . ' AS t, ' . USERS_TABLE . ' AS u,
' . POSTS_TEXT_TABLE . ' AS pt, ' . POSTS_TABLE . ' AS p WHERE t.forum_id IN (' . $forumid . ') AND
t.topic_time <= ' . time() . ' AND t.topic_poster = u.user_id AND t.topic_first_post_id = pt.post_id AND
t.topic_first_post_id = p.post_id AND t.topic_status <> 2 ORDER BY t.topic_time DESC LIMIT 0,
' . $how_many_news . '';
$result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result) )
{
$bbcode_uid=$row['bbcode_uid'];
$text = $row['post_text'];
if ( $bbcode_uid != '' )
{
$text = bbencode_second_pass($text, $bbcode_uid, $userdata['username']);
if ( strpos($text, "[hide:$bbcode_uid]") !== false )
{
if ( !$userdata_reply_buffered )
{
$valid = false;
if ( $session_logged_in )
$sql = "SELECT poster_id, topic_id FROM " . POSTS_TABLE . "WHERE topic_id = $topic_id
AND poster_id = $user_id";
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? true : false;
}
$userdata_reply_buffered = true;
}
$text = bbencode_third_pass($text, $bbcode_uid, $valid);
}
$text = nl2br($text);
$text = smilies_pass($text);
$text = make_clickable($text);
$text = substr($text, 0, $newslength);
$row['topic_title'] = substr($row['topic_title'], 0, $topiclength);
$row['topic_time'] = $postdate;
$tl = $phpbb_root_path;
$tl .= append_sid('viewtopic.'.$phpEx.'?t='.$row['topic_id']);
$tt = $row['topic_title'];
$al = $phpbb_root_path;
$al .= append_sid('profile.'.$phpEx.'?mode=viewprofile&u='.$row['user_id'].'');
$a = $row['username'];
$d = create_date($lang['DATE_FORMAT'], $row['post_time'], $board_config['board_timezone']);
$cl = $phpbb_root_path;
$cl .= append_sid('viewtopic.' . $phpEx . '?t=' . $row['topic_id']);
$r = '?mode=news&newsid='.$row['topic_id'].'';
$przemo_news=array(
"sitename"=>"$sitename",
"posted"=>"$posted",
"posted_by"=>"$posted_by",
"topic_title_link"=>"$tl",
"topic_title"=>"$tt",
"author_link"=>"$al",
"author"=>"$a",
"date"=>"$d",
"news_text"=>"$text",
"comment_link"=>"$cl",
"comment"=>"$comment",
"read"=>"$read",
"read_back_link"=>"$r",
"read_back_text"=>"$readnews"
);
echo template($przemo_news, $style);
}
$db->sql_freeresult($result);
break;
case 'news';
$sql = 'SELECT t.topic_id, t.topic_time, t.topic_title, pt.post_text, u.username, u.user_id, u.user_rank, u.user_posts,
t.topic_replies, pt.bbcode_uid, t.forum_id, t.topic_poster, t.topic_first_post_id, t.topic_status, pt.post_id,
p.post_id, p.post_time, p.enable_smilies FROM ' . TOPICS_TABLE . ' AS t, ' . USERS_TABLE . ' AS u,
' . POSTS_TEXT_TABLE . ' AS pt, ' . POSTS_TABLE . ' AS p WHERE t.forum_id IN (' . $forumid . ') AND
t.topic_time <= ' . time() . ' AND t.topic_poster = u.user_id AND t.topic_first_post_id = pt.post_id AND
t.topic_first_post_id = p.post_id AND t.topic_status <> 2 AND t.topic_id = '.$_GET['newsid'].' ORDER BY t.topic_time DESC LIMIT 0,
' . $how_many_news . '';
$result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result) )
{
$bbcode_uid=$row['bbcode_uid'];
$text = $row['post_text'];
if ( $bbcode_uid != '' )
{
$text = bbencode_second_pass($text, $bbcode_uid, $userdata['username']);
if ( strpos($text, "[hide:$bbcode_uid]") !== false )
{
if ( !$userdata_reply_buffered )
{
$valid = false;
if ( $session_logged_in )
$sql = "SELECT poster_id, topic_id FROM " . POSTS_TABLE . "WHERE topic_id = $topic_id
AND poster_id = $user_id";
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? true : false;
}
$userdata_reply_buffered = true;
}
$text = bbencode_third_pass($text, $bbcode_uid, $valid);
}
$text = nl2br($text);
$text = smilies_pass($text);
$text = make_clickable($text);
$row['topic_title'] = substr($row['topic_title'], 0, $topiclength);
$row['topic_time'] = $postdate;
$tl = $phpbb_root_path;
$tl .= append_sid('viewtopic.'.$phpEx.'?t='.$row['topic_id']);
$tt = $row['topic_title'];
$al = $phpbb_root_path;
$al .= append_sid('profile.'.$phpEx.'?mode=viewprofile&u='.$row['user_id'].'');
$a = $row['username'];
$d = create_date($lang['DATE_FORMAT'], $row['post_time'], $board_config['board_timezone']);
$cl = $phpbb_root_path;
$cl .= append_sid('viewtopic.' . $phpEx . '?t=' . $row['topic_id']);
$r = 'index.php';
$przemo_news=array(
"sitename"=>"$sitename",
"posted"=>"$posted",
"posted_by"=>"$posted_by",
"topic_title_link"=>"$tl",
"topic_title"=>"$tt",
"author_link"=>"$al",
"author"=>"$a",
"date"=>"$d",
"news_text"=>"$text",
"comment_link"=>"$cl",
"comment"=>"$comment",
"read"=>"$read",
"read_back_link"=>"$r",
"read_back_text"=>"$back"
);
echo template($przemo_news, $style);
}
$db->sql_freeresult($result);
break;
}
//Usuwanie poniższego kodu jest złamaniem warunków licencji i będzie skutkować brakiem pomocy technicznej w razie problemów ze skryptem.
echo '<span class="footer">Powered by przemoNEWS. <br> Written by <a href="http://www.backbone.neth.pl" target="_blank">Bucu</a> © 2008 - '.date(Y).'</span></center>';
?> |
|
|
|