Very nice theme you got going there. Hope your forum takes off well.
2 2006-10-23 14:47
Topic: Getting a username with ID (1 replies, posted in PunBB 1.2 troubleshooting)
Hi, I'm just messing around really trying to broaden my PHP skills (which are like next to nothing )
anyway, I'm just making a page which will display lots of things about a particular user ( i know that's on the profile but meh ) it is similiar to profile.php in the way that it uses id.
so stats.php?id=2 etc..
I grabe the ID:
$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
if ($id < 2)
message($lang_common['Bad request']);
But I'm trying to run a query to the DB to get the username for this ID. I thought it was this:
$stats_name = $db->query('SELECT username FROM '.$db->prefix.'users WHERE id='.$id);
Obviously not though, so could somebody help me please?
EDIT: Btw, when I use this query then use
<?php echo($stats_name) ?>
it returns " Resource id #13 "
3 2006-10-23 13:31
Topic: Has anybody ever thought (9 replies, posted in PunBB 1.2 discussion)
Of making a PunBB for mobile phones. I've just had my new phone (o2 XDA Mini S) which uses Wap etc, but will conect to my wireless network so I use that for browsing the net and MSN etc..
Making this would give users the availibility to use PunBB forums where ever they are!
It would be an AMAZING feature as I don't think ANY other forum script has it.
ricketh.
4 2006-10-23 13:01
Re: Fetching user ID number. (2 replies, posted in PunBB 1.2 troubleshooting)
Never mind guys, I've figured it out.
<a href="profile.php?id='.$pun_user['id'].'">'.pun_htmlspecialchars($pun_user['username']).'</a>
5 2006-10-23 12:47
Topic: Fetching user ID number. (2 replies, posted in PunBB 1.2 troubleshooting)
Hi guys, I just want to simply create a link at the top of the page where it says "Logged in as blah blah". I want the URL to be the users name and when clicked I want the link to take the user to their profile to edit and what not. But, I don't know how to fetch the user id from the database.
I see in header.php this is where I have to do it:
$tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<ul class="conl">'."\n\t\t\t\t".'<li>'.$lang_common['Logged in as'].' <strong>'.pun_htmlspecialchars($pun_user['username']).'</strong></li>'."\n\t\t\t\t".'<li>'.$lang_common['Last visit'].': '.format_time($pun_user['last_visit']).'</li>';
I'm guessing I'd have to create the url around the $pun_user part so it would be like:
$tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<ul class="conl">'."\n\t\t\t\t".'<li>'.$lang_common['Logged in as'].' <strong><a href="/profile.php?id=ID NUMBER HERE"> '.pun_htmlspecialchars($pun_user['username']).' </a></strong></li>'."\n\t\t\t\t".'<li>'.$lang_common['Last visit'].': '.format_time($pun_user['last_visit']).'</li>';
Thanks in advance for help guys.
ricketh.
6 2006-10-23 12:40
Re: Please Help with Miniportal Setup (18 replies, posted in PunBB 1.2 troubleshooting)
If you want to change the message that <pun_status> delivers, you can change that in header.php. Changing the style of it, you would have to add some CSS for it in your index.php.
I'm trying to recall where the footer links are.. but can't remember, I'll get back to you if I do.
7 2006-10-23 12:30
Re: punBB and BBCode using the URL function (2 replies, posted in PunBB 1.2 discussion)
No problem.
8 2006-10-22 13:42
Re: Private Message mod v1.2.2 (204 replies, posted in PunBB 1.2 modifications, plugins and integrations)
I get this error:
File: /home/simzicou/domains/simzi.co.uk/public_html/install_mod.php
Line: 76
PunBB reported: Unable to add columns to table
Database reported: Duplicate column name 'g_pm' (Errno: 1060)
9 2006-10-20 21:58
Re: 60 Second Posting Rule (2 replies, posted in PunBB 1.2 discussion)
Thank you very much sir!
10 2006-10-20 21:45
Topic: 60 Second Posting Rule (2 replies, posted in PunBB 1.2 discussion)
Is there anyway of disabling this?
11 2006-10-20 19:00
Re: Wierd random link. (10 replies, posted in PunBB 1.2 troubleshooting)
Hm.. thanks for all yuor help guys. Loads of people have been complaining to me on msn about the portal and they don't like it so i've removed it anyway. I liked it! But if it's gonna deterr members I'll take it off. thanks.
12 2006-10-20 18:39
Re: Wierd random link. (10 replies, posted in PunBB 1.2 troubleshooting)
Surely if the unclosed <a> tag was the issue it would be somewhere here:
if (in_array(basename($_SERVER['PHP_SELF']), array('forum.php', 'search.php')))
$tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
else
$tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
i can't see any unclosed tags :S
13 2006-10-20 16:25
Re: Wierd random link. (10 replies, posted in PunBB 1.2 troubleshooting)
I've just noticed that the issue is only affecting internet explorer browsers. This is wierd.
14 2006-10-20 14:30
Re: Wierd random link. (10 replies, posted in PunBB 1.2 troubleshooting)
But pages like, viewforum.php don't use the sidebar, infact they use a totally different template :S.. the site is http://www.simzi.co.uk could you just take a little peak ?
15 2006-10-20 08:56
Re: Wierd random link. (10 replies, posted in PunBB 1.2 troubleshooting)
I have a feeling it's got something to do with this code in header.php, please correct me if i'm wrong!
// START SUBST - <pun_status>
if ($pun_user['is_guest'])
$tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<p>'.$lang_common['Not logged in'].'</p>'."\n\t\t".'</div>';
else
{
$tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<ul class="conl">'."\n\t\t\t\t".'<li>'.$lang_common['Logged in as'].' <strong>'.pun_htmlspecialchars($pun_user['username']).'</strong></li>'."\n\t\t\t\t".'<li>'.$lang_common['Last visit'].': '.format_time($pun_user['last_visit']).'</li>';
if ($pun_user['g_id'] < PUN_GUEST)
{
$result_header = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'reports WHERE zapped IS NULL') or error('Unable to fetch reports info', __FILE__, __LINE__, $db->error());
if ($db->result($result_header))
$tpl_temp .= "\n\t\t\t\t".'<li class="reportlink"><strong><a href="admin_reports.php">There are new reports</a></strong></li>';
if ($pun_config['o_maintenance'] == '1')
$tpl_temp .= "\n\t\t\t\t".'<li class="maintenancelink"><strong><a href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong></li>';
}
if (in_array(basename($_SERVER['PHP_SELF']), array('forum.php', 'search.php')))
$tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
else
$tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
}
$tpl_main = str_replace('<pun_status>', $tpl_temp, $tpl_main);
// END SUBST - <pun_status>
I have
if (in_array(basename($_SERVER['PHP_SELF']), array('forum.php', 'search.php')))
in header.php so that it shows the new posts and mark all topic links on the forum index, as i'm using the mini portal.
16 2006-10-20 08:35
Topic: Wierd random link. (10 replies, posted in PunBB 1.2 troubleshooting)
Hi guys,
I've got a problem..
On the mini portal index page, if I hover my mouse over the "Who's Online" box anywhere other than user links gives me a link to Mark all topics as read.
This same link is behind the menu links in the Admin Menu and the header where is says "You're logged in as blah blah".
Can anybody shed some light on this?
17 2006-10-20 07:31
Re: PunBB Miniportal v1.2.x (128 replies, posted in PunBB 1.2 modifications, plugins and integrations)
I was goign to do that if this method wasn't possible. I just wanted to change the way the news is delivered on the front of the mini portal.
18 2006-10-20 07:26
Re: Show new posts since last visit and mark all topics as read (5 replies, posted in PunBB 1.2 troubleshooting)
Oh dear, thanks Smartys that's a great help !
I owe you.
19 2006-10-19 22:47
Re: Show new posts since last visit and mark all topics as read (5 replies, posted in PunBB 1.2 troubleshooting)
Nope.. Doesn't work :S
20 2006-10-19 22:06
Topic: Show new posts since last visit and mark all topics as read (5 replies, posted in PunBB 1.2 troubleshooting)
Both of these links that usually show up towards the top right of the page are not showing on my forum.
I'm using the mini portal. The index.php relies on the index.tpl template file (The links show FINE on this page)
The index.php gets its template from the header file in which I added:
else if (defined('PUN_QUIET_VISIT'))
$tpl_main = file_get_contents(PUN_ROOT.'include/template/index.tpl');
This tells the index.php to use the index.tpl template.
For all other pages I've left the code in header.php alone so it's still:
else
$tpl_main = file_get_contents(PUN_ROOT.'include/template/main.tpl');
BUT - the show new posts since last visit and mark all topics as read links don't show on ANY page other than the index.php. The main.tpl template I'm using is the standard template which is straight from the 1.2.14 download package.
Can anybody help me PLEASE, i've spent so long trying to figure out why it's not working.
My forum URL is: http://www.simzi.co.uk/
Thanks in advance guys.
EDIT: the links show in search.php
21 2006-10-19 21:04
Re: Simzi.co.uk (2 replies, posted in PunBB 1.2 show off)
cheers, why not register
22 2006-10-19 21:01
Re: Miniportal trick (9 replies, posted in PunBB 1.2 modifications, plugins and integrations)
You can see the links on the forum, and viewtopic.php ?! I can't :S.. none of my other members can either actually..
and thanks for making that version of oxygen mate it's lovely.
23 2006-10-19 20:50
Re: Miniportal trick (9 replies, posted in PunBB 1.2 modifications, plugins and integrations)
24 2006-10-19 20:49
Re: Miniportal trick (9 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Yep it's in there, it's the first thing I checked:S
25 2006-10-19 20:38
Re: Miniportal trick (9 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Okay, now I'm really stumbled..
I've removed the define('forum, 1'); and the code from the header, so it's like standard stuff with the mini portal so i could try and fix it.. but even though all the stuff is back to how it was the Show new posts and mark all posts as read links still don't appear?!
somebody help !! eek!