I'm about to start redoing my frontpage i just want the latest topics and some of the article i have wrote but i dont want it in a block style like the viewtopics in the forum. more or less like a written article.
Q
You are not logged in. Please login or register.
PunBB Forums → Posts by quaker
I'm about to start redoing my frontpage i just want the latest topics and some of the article i have wrote but i dont want it in a block style like the viewtopics in the forum. more or less like a written article.
Q
i will give you my index.php and main.tpl
and latesttopics.
index.php
<?php
define('PUN_PORTAL', 1);
define('PUN_ROOT', './');
require_once PUN_ROOT.'include/common.php';
//Set the page title here
$page_title = pun_htmlspecialchars($pun_config['o_board_title']) . ' / Home of MC';
define('PUN_ALLOW_INDEX', 1);
require_once PUN_ROOT.'header.php';
require_once PUN_ROOT.'include/parser.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/index.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/topic.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';
//----------------------------------------------------------------------//
//These are the forums from which the news is retrieved
$forumids = array(1,3);
//This is the overall limit for how many news items will be displayed
$master_limit = '5';
//This is the amount of characters above which truncation will occur
$trunc_chars = '50';
//----------------------------------------------------------------------//
function close_tags($string)
{
if (preg_match_all ('/<([a-z]+)[ >]/', $string, $start_tags))
{
$start_tags = $start_tags[1];
if (preg_match_all ('/<\/([a-z]+)>/', $string, $end_tags))
{
$complete_tags = array();
$end_tags = $end_tags[1];
foreach ($start_tags as $key => $val)
{
$posb = array_search ($val, $end_tags);
if (is_integer ($posb))
{
unset ($end_tags[$posb]);
}
else
{
$complete_tags[] = $val;
}
}
}
else
{
$complete_tags = $start_tags;
}
$complete_tags = array_reverse ($complete_tags);
for ($i = 0; $i < count ($complete_tags); $i++)
{
$string .= '</' . $complete_tags[$i] . '>';
}
}
// Removes irrelevant tags
$xhtml_tags = array ('</img>', '</hr>', '</br>');
$string = str_replace ($xhtml_tags, '', $string);
return $string;
}
//----------------------------------------------------------------------//
function truncate($string)
{
global $pun_config;
$trunc_chars = '350';
$length = $trunc_chars;
$append = '...';
if (strlen ($string) <= $length)
{
return $string;
}
else if ($length > 0)
{
preg_match ('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){'.$length.',}\b#U', $string, $matches);
$string = $matches[0];
$string = close_tags (preg_replace ('#\s*<[^>]+>?\s*$#', '', $string).$append);
return $string;
}
}
//----------------------------------------------------------------------//
$result = $db->query('SELECT t.id, t.subject, t.num_replies, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.forum_id, u.use_avatar, u.num_posts, u.registered, u.title, p.poster, p.poster_id, p.message, p.hide_smilies, p.posted, g.g_title, f.forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON p.topic_id=t.id AND p.posted=t.posted INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE t.forum_id IN ('.implode(',', $forumids).') AND t.moved_to IS NULL AND f.redirect_url IS NULL ORDER BY t.posted DESC LIMIT '.$master_limit) or error('Unable to fetch announcements', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result))
{
while($cur_post = $db->fetch_assoc($result))
{
echo '<div class="block">';
if ($pun_config['o_avatars'] == '1' && $cur_post['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
{
if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif'))
{
$user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img title="header=[<span class=\'box_username\'> '.pun_htmlspecialchars($cur_post['poster']).'] body=[<span class=\'box_info\'> Title: '.$cur_post['g_title'].'<br /> Total Post: '.$cur_post['num_posts'].'<br /> Registered Date: '. format_time($cur_post['registered'], true).']</span>" src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' alt="'.$cur_post['poster'].'\'s Avatar" /></a>';
}
else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg'))
{
$user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img title="header=[<span class=\'box_username\'> '.pun_htmlspecialchars($cur_post['poster']).'] body=[<span class=\'box_info\'> Title: '.$cur_post['g_title'].'<br /> Total Post: '.$cur_post['num_posts'].'<br /> Registered Date: '. format_time($cur_post['registered'], true).']</span>" src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' alt="'.$cur_post['poster'].'\'s Avatar" /></a>';
}
else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png'))
{
$user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img title="header=[<span class=\'box_username\'> '.pun_htmlspecialchars($cur_post['poster']).'] body=[<span class=\'box_info\'> Title: '.$cur_post['g_title'].'<br /> Total Post: '.$cur_post['num_posts'].'<br /> Registered Date: '. format_time($cur_post['registered'], true).']</span>" src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' alt="'.$cur_post['poster'].'\'s Avatar" /></a>';
}
}
else
{
$user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="img/noimage.gif" alt=""/></a>';
}
$news_message = parse_message($cur_post['message'], $cur_post['hide_smilies']);
if (pun_strlen($news_message) > $trunc_chars)
{
$news_message = truncate($news_message);
$read_more = ' | <a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_post['id'].'">Read More</a> | ';
}
else
{
$read_more = ' | ';
}
if ($cur_post['num_replies'] != '0')
{
$replies = ' <a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_post['id'].'#p'.$cur_post['last_post_id'].'">Replies</a>: '.$cur_post['num_replies'].' ';
}
else
{
$replies = ' Replies: '.$cur_post['num_replies'].' ';
}
echo "\t\t\t\t\t\t\t".'<h2><strong><a href="forum.php">Forum</a> » <a href="viewforum.php?id='.$cur_post['forum_id'].'">'.pun_htmlspecialchars($cur_post['forum_name']).'</a>'.'</strong></h2>'."\n";
?>
<div class="box">
<div class="inbox">
<ul><li>
<table width="100%" border="0">
<tr>
<td style="border: 0px; padding: 0px 10px 7px 7px;"><a class="news_subject" href="viewtopic.php?id=<?php echo $cur_post['id']; ?>"><?php echo $cur_post['subject']; ?></a></td>
</tr>
</table>
<table width="100%" border="0">
<tr>
<td style="text-align: justify; border: 0px; padding-top: 0px;" valign="top"><?php echo $news_message."\n" ?></td>
</tr>
</table>
<table class="news_footer" width="100%">
<tr>
<td>
<?php
echo "\t\t\t\t\t\t\t".'<span class="user" style="float:left">Posted: '.format_time($cur_post['posted']).' by:<span class="user'.(isset($cur_post['g_title']) ? ' '.strtolower(str_replace(' ', '', $cur_post['g_title'])) : '').'"> <a class="poster" href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['poster']).'</a><br/>'.$read_more.'Views: '.$cur_post['num_views'].' |'.$replies.'</span></span>'."\n";
if ($cur_post['poster_id'] == $pun_user['id'] || $pun_user['g_id'] < PUN_GUEST)
{
echo "\t\t\t\t\t\t\t".'<a href="viewtopic.php?id='.$cur_post['id'].'">'.pun_htmlspecialchars($lang_portal['Visit_Topic']).'</a>'.'<span style="white-space: nowrap; float:right">'.'<a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.' | <a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a> | <a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.' | <a href="post.php?tid='.$cur_post['id'].'">'.'Reply'.'</a>'.' | <a href="post.php?tid='.$cur_post['id'].'&qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>'.'</span>'."\n\n\n\n";
}
?>
</td>
</tr>
</table>
</li></ul>
</div>
</div><div class="block">
<h2><span>Welcome</span></h2>
<div class="box">
<div class="inbox">
<p>
</p>
<p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="border: 0px"; ><h2>YouTube Video's!</h2><center> <object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/fKQRu9G6Zbk"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/fKQRu9G6Zbk" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></td></center>
</tr>
</table>
<p>
</div>
</div>
</div>
</div>
<?php
}
}
require PUN_ROOT.'footer.php';
latesttopics.php
<div class="block">
<h2 class="block2"><span>Top News Topics</span></h2>
<div class="box">
<?
$result = $db->query('SELECT subject, id FROM '.$db_prefix.'topics ORDER BY last_post DESC LIMIT 4') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
while($cur_topic = $db->fetch_assoc($result))
{
?>
<li>»<a href="viewtopic.php?id=<?php echo $cur_topic['id']; ?>"><?php echo $cur_topic['subject']; ?></a> </li>
<?
}
?>
</div>
</div>
my portal.tpl
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html dir="<pun_content_direction>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
<meta name="verify-v1" content="RjWVco8IL3AdatTi5Ir5EdXjx9vjWMtnTMEFrnYBYE8=" />
<pun_head>
<style type="text/css">
#left {
width: 254px;
float: right;
}
#main {
margin-right: 264px;
}
#container {
width: 100%;
float: left;
margin-right: -254px;
}
</style>
</head>
<body>
<div id="punwrap">
<div id="pun<pun_page>" class="pun">
<div id="brdheader" class="block">
<div class="box">
<div id="brdtitle" class="inbox">
<pun_title>
<pun_desc>
</div>
<pun_navlinks>
<pun_status>
</div>
</div>
<div id="container">
<div id="main">
<pun_announcement>
<pun_include "latesttopics.php">
<pun_main>
</div>
</div>
<div id="left">
<div class="bloque1">
<h3><span>search</span></h3>
<div class="buscar">
<pun_include "search.php">
</div><p></p><p></p>
</div>
<div class="bloque2">
<h3>Menu</h3>
<div class="box">
<pun_sidelinks>
</div><p></p><p></p>
</div>
<div class="bloque1">
<h3>Random Images</h3>
<div class="box">
<div class="inbox">
<pun_include "ran.php">
</div>
</div><p></p><p></p>
</div>
<div class="bloque2">
<h3>Affiliates</h3>
<div class="box">
<div class="inbox">
<pun_include "affiliates.php">
</div>
</div><p></p><p></p>
</div>
<div class="bloque1">
<h3>Whos Online?</h3>
<div class="box">
<pun_online>
</div>
</div><p></p><p></p>
<div class="bloque2">
<h3>Adsense</h3>
<div class="box">
<div class="inbox">
<center>
<script type="text/javascript"><!--
google_ad_client = "pub-2086538475721432";
google_ad_width = 200;
google_ad_height = 200;
google_ad_format = "200x200_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "ffffff";
google_color_bg = "ffffff";
google_color_link = "FFFFFF";
google_color_text = "FFFFFF";
google_color_url = "FFFFFF";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
</div>
</div><p></p><p></p>
</div>
<p></p><p></p>
</div>
<div class="clearer"></div>
<pun_footer>
</div>
</div>
</body>
</html>
oh...
ok now i know what you are talking about
u want sidebar newest topics and forum on one page.
that all done in the main tpl.
just put ur
latesttopics mod about the
<pun_include "latesttopics.php"> example
pun_main tag
and so on.
Q
go to... http://punres.org
click on wiki across top menu
look for mini portal
that a start...
Q
you can create a portal.tpl
and call it on certain pages.....
example
http://modelcrowd.com ---------------------> portal.tpl
http://modelcrowd.com/gallery.php -------> main.tpl
Q
how about designing a graph like punres stats. it displays in a graph ?
Q
true jeremie, i have put in alot of google's code to help index my site.
DrJ.
i have two parts the search code and the result page link code
i installed the google cusomt search engine into my site.
http://modelcrowd.com try it out it on the index...
make sure you create a results page like i did.
http://modelcrowd.com/results.php
it will display your search result in it.
it is just a blank new page(with the google results code) from the wiki -miniportal sections.
Q
here is the link to get your own custom search.
http://www.google.com/coop/cse/
Have a website or collection of sites you'd like to search over? With Custom Search Engine, you can harness the power of Google to create a search engine tailored to your needs.
Create a search engine tailored to your needs
* Include one website, multiple websites, or specific webpages
* Host the search box and results on your own website
* Customize the colors and branding to match your existing webpages
* Learn more with our featured examples, developer documentation, and FAQs
Learn how Custom Search benefits...
Your website, blog, or special interest group
* Help your visitors find what they're looking for
* Invite your friends and community to contribute
* Make money with AdSense for Search
* New! Automatically generate a search engine based on the links on your website or blogroll with Custom Search on the fly
Your business or enterprise New!
* Take advantage of Custom Search Business Edition for added benefits, like enterprise-grade support, ads-free results pages, and the XML API
* Put your own logo on the search results pages
* Help customers navigate your site and find the products they want to buy
Your non-profit, government, or educational organization
where is a good start for looking at integrating my gallery?
here is the login.php from the gallery.
<?php
require_once '../library/config.php';
require_once '../library/functions.php';
$errMsg = '';
if (isset($_POST['txtUserid'])) {
// Check the user login. For now we only check it
// against a hardcoded value
if ($_POST['txtUserid'] == 'admin' && $_POST['txtUserpw'] == 'jetfire') {
$_SESSION['isLogin'] = true;
header('Location: index.php?page=list-album');
exit;
} else {
$errMsg = "Wrong Id/Password";
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p> </p>
<?php
if ($errMsg != '') {
echo '<p align="center"><font color="#990000">' . $errMsg . '</font></p>';
}
?>
<form action="" method="post" name="frmCampaign" id="frmCampaign">
<table align="center" width="500" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="200" bgcolor="#336699"><font color="#FFFFFF"><strong>User Id</strong></font></td>
<td bgcolor="#FFFFFF"><input name="txtUserid" type="text" id="txtUserid" value="username"></td>
</tr>
<tr>
<td width="200" bgcolor="#336699"><font color="#FFFFFF"><strong>Password</strong></font></td>
<td bgcolor="#FFFFFF"><input name="txtUserpw" type="password" id="txtUserpw" value="password"></td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#FFFFFF"> <input type="submit" name="Submit" value="Submit">
</td>
</tr>
</table>
</form>
</body>
</html>
you are looking for #punwrap in the cs or _css width:850px or what ever....
Q
ops sorry paul..
Q
login as admin... go to options..
scroll down you will see annoucements....
Q
Burnsy86, try my index mod that dude07 links to..
Q
thanks... i was going threw my dreamweaver css info.. and seen it. now i got to do the menu so i can build a sidebar ...
Q
how can i remove the bullets from a li?
example: http://bunpai.com
on the menu list and top ten articles
link?
i like the style.. very kewl looking.... almost thought it was a cms and punbb...
good job...
maybe make a computer mod icon instead of KDE.
Q
lol..
Q
does any normal calendar not do the same functions as pbb calendar?
i list a event for aug 23th and it shows up in the month of aug calendar ?
i made some mods for it. like showing birthdays and some events on a sidebar portal system.
thanks to twohawk and others
Anbidian why not set the width so that it matches ur main site?
look in the wiki for the code...
Q
my mail system wors fine with out adding the mail server info. humm i use to have big issue with that with my old host. come to find out they was listed on some blacklist because a client was spamming...
Q
kier,thanks ill look at that tomorrow..
mattf, i will also look at that, im not a true programmer so bare with me.
saint i read that article a while back.
i never got the notice that someone replied back to my thread..
Q
Pog, i was thinking that.. the version # but not sure .
Q
i had it working on my site. but i decided to completely redo it. i will install it and get it back working
Q
all i can do is try.. i just had formated my pc and i had to install dreamweaver just to look at the css... i guess you could say im a dw addicted...
Q
ok put the adsense in a php file
copy adsense content to adsense.php
and place it in the include/user folder.
nexted create this.(pun tag next to the logo)<p align="right"><pun_include "adsense.php"></p>
what that will do is place the adsense banner to the right
PunBB Forums → Posts by quaker
Powered by PunBB, supported by Informer Technologies, Inc.