1

(4 replies, posted in PunBB 1.2 troubleshooting)

Okay nevermind. I'm either dumb as a box of rocks or just blond. The whole Oct 21 thing is when everyone registered. The post date is correct... I was seeing the Oct 21 part in the posts and thinking that was the posts date, but its when the users registered.

My bad
Juston

2

(4 replies, posted in PunBB 1.2 troubleshooting)

okay I just noticed that the date is stuck on Oct 21... o_O

3

(4 replies, posted in PunBB 1.2 troubleshooting)

Okay, I did the php thing, it returned todays date:

Sat, 01 Nov 2008 15:56:46 -0400

I asked a couple users of my board, they are experiencing the same problem...As far as when it started, I noticed it thursday, but didnt think anything about it, then friday when I posted, it said I posted on Oct 21, and I havent made any changes to the board or anything since I installed it a week ago.

Thanks helping..

Juston

4

(4 replies, posted in PunBB 1.2 troubleshooting)

Hello,

I am having a date displaying problem. I noticed today, that anyone that posted today (Oct 31) the date shows as Oct 21, which is off by 10 days. I logged into my server under root to verify the date and the date in the server is correct. Is there a way I can change the date setting in forum so that the dates are correct?

Hello....

I have a script that pulls the latest topics & displays them on the main page of my website. In my forum, I have a section for Admins & mods only. Now, my problem is when someone posts in that forum, its displayed in the "newest topics" box along with everything else. Is there a way I can have it not pull topics from the  members only forum?

Heres my script...

<?
  $MySQL['Server'] = "localhost"; 
  $MySQL['User'] = "-----";
  $MySQL['Pass'] = "--------";
  $MySQL['Database'] = "stk_forums";

  MySQL_Connect($MySQL['Server'], $MySQL['User'], $MySQL['Pass']) OR Die("Failed to establish the connection.");
  MySQL_Select_db($MySQL['Database']);
    
  $result = mysql_query("SELECT subject, last_poster, num_views, id FROM punbb_topics ORDER BY last_post DESC LIMIT 10");
  if (!$result)
  {
  $message = "Invalid query: " . mysql_error() . "\n";
  die($message);
  }
  while ($row = mysql_fetch_assoc($result))
  {
  echo '<img border="0" src="iconset/list.gif" width="12" height="10">&nbsp;&nbsp;<font face="Verdana" style="font-size: 9pt" color="white"><a style="text-decoration: none" href="/boards/viewtopic.php?id=' . $row['id'] . '">'. $row['subject'] . '</a><br>';
  }  
  mysql_free_result($result);
?>

***EDIT***
Nevermind...

Slavok wrote:

Use smth like that to determine who the user is.

//if user guest
if ($pun_user['is_guest'])
  code;
//if user is a administrator
else if ($pun_user['group_id] == 1)
  code;
//if user is not an admin
else
  code;

Okay I have been trying to get the above working right, but I am having nothing but problems. Someone please tell me what im doing wrong.... heres my code....

<?php
//define('PUN_ROOT', './boards/');
//require PUN_ROOT.'include/common.php';
//define('PUN_QUIET_VISIT', 1);

if (!$pun_user['is_guest']) {
      echo '<p align="center" style="margin-top: 0; margin-bottom: 2"><font face="Verdana" style="font-size: 9pt" color="#FFFFFF">Hello '.pun_htmlspecialchars($pun_user['username']);
      
      $avatardir = "boards/img/avatars";
            if ($img_size = @getimagesize($avatardir.'/'.$pun_user['id'].'.gif'))
                $user_avatar = '<img src="'.$avatardir.'/'.$pun_user['id'].'.gif" alt="" border="0"/>
<body topmargin="0" leftmargin="0">

';
            else if ($img_size = @getimagesize($avatardir.'/'.$pun_user['id'].'.jpg'))
                $user_avatar = '<img src="'.$avatardir.'/'.$pun_user['id'].'.jpg" alt="" border="0"/>';
            else if ($img_size = @getimagesize($avatardir.'/'.$pun_user['id'].'.png'))
                $user_avatar = '<img src="'.$avatardir.'/'.$pun_user['id'].'.png" alt="" border="0" />';
else
$user_avatar = '<img src="'.$avatardir.'/no-avatar.jpg" alt="" border="0" /><br>';


echo "<br><br>$user_avatar<br><br>";
//if user is a admin
if ($pun_user['g_id'] == 1)
echo "";
echo "Forum Admin<br>";
echo "Poll Admin<br>";
echo "Webmail<br>";
//For All Members
else if ($pun_user['group_id'] == 4)
echo "Your Profile<br>";
echo "Message Box<br><br>";
echo "<b><font face='Verdana' style='font-size: 9pt' color='white'><a  style='text-decoration: none' href='boards/login.php?action=out&amp;id=".$pun_user['id']."&amp;csrf_token=".sha1($pun_user['id'].sha1(get_remote_address()))."'>".$lang_common['Logout']."</a><br><br>" ; }
else
{
    $redirect_url = '' ;
    if(isset($_SERVER['REQUEST_URI']))
        $redirect_url = $_SERVER['REQUEST_URI'] ;
 
    require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';
     echo '<center><p align="center" style="margin-top: -15; margin-bottom: 2"><font face="Verdana" style="font-size: 9pt" color="white"><br>Welcome Guest</font></center>';
?>

And this is the error I keep getting...

PHP Parse error:  syntax error, unexpected T_ELSE in /var/www/web3/web/login.php on line 31

I have no clue what im doing wrong but any help would be great! smile

thanks
Juston

7

(6 replies, posted in PunBB 1.2 troubleshooting)

Hi, I have punbb set up and I have a sig set up on my profile, but how do I get them to show up in the posts?


Thanks
Juston

hello, I've read several posts on here about adding addional links to punbb, but none that I have found cover adding links to the Admin panel. I have an external website (outside the forum dir) that I have a couple things added to, like a poll, and a news manager, I was wondering if there was a way I can add links to these to the bottom of my admin panel? maybe add another nav block called something like "Additional Tasks" and in it have "News Manager, Poll Manger, blah blah"

Thanks
Juston

Sorry I didnt see your message in time.... turns out I had another script that wasnt making a database connection, it was no fault of punbb... smile

I thought I had it fixed, but still getting the data base errors sad(

I was able to fix it myself... there was something wrong with the redirect.tpl after I modified it, I just went back to using the default one

okay I have another login iissue.....

I have integrated my forums with my site....

http://www.xalaris.net/boards/index.php

When I try to login on the login box I created, I get a white page that says "Unable to Connect to Database!!" but if I go back, im logged in. The same thing happends when I try to log out...

I have put the following login script in my /includes/user folder and I have it included on my main.tpl using <pun_include "login.php">

<?php
define('PUN_ROOT', '../');
define('PUN_QUIET_VISIT', 1);
if (!$pun_user['is_guest']) {
      echo '<p align="center" style="margin-top: 0; margin-bottom: 2"><font face="Verdana" style="font-size: 9pt" color="#FFFFFF">Hello '.pun_htmlspecialchars($pun_user['username']);
      
      $avatardir = "img/avatars";
            if ($img_size = @getimagesize($avatardir.'/'.$pun_user['id'].'.gif'))
                $user_avatar = '<img src="'.$avatardir.'/'.$pun_user['id'].'.gif" alt="" border="0"/>
<body topmargin="0" leftmargin="0">

';
            else if ($img_size = @getimagesize($avatardir.'/'.$pun_user['id'].'.jpg'))
                $user_avatar = '<img src="'.$avatardir.'/'.$pun_user['id'].'.jpg" alt="" border="0"/>';
            else if ($img_size = @getimagesize($avatardir.'/'.$pun_user['id'].'.png'))
                $user_avatar = '<img src="'.$avatardir.'/'.$pun_user['id'].'.png" alt="" border="0" />';
else
$user_avatar = '<img src="'.$avatardir.'/no-avatar.jpg" alt="" border="0" />';

echo "<br><br>$user_avatar<br><br><b><font face='Verdana' style='font-size: 9pt' color='white'><a href='boards/login.php?action=out&amp;id=".$pun_user['id']."&amp;csrf_token=".sha1($pun_user['id'].sha1(get_remote_address()))."'>".$lang_common['Logout']."</a><br><br>" ; }

else
{
    $redirect_url = '' ;
    if(isset($_SERVER['REQUEST_URI']))
        $redirect_url = $_SERVER['REQUEST_URI'] ;
 
    require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';
     echo '<center><p align="center" style="margin-top: -15; margin-bottom: 2"><font face="Verdana" style="font-size: 9pt" color="white"><br>Welcome Guest</font></center>';
?>
           <form id="login" method="post" action="<?php echo PUN_ROOT.'login.php?action=in'; ?>">
            <input type="hidden" name="form_sent" value="1" />
            <input type="hidden" name="redirect_url" value="<?php echo $redirect_url ?>" />  
            <p align="center" style="margin-top: 2; margin-bottom: 2">
            <b><font face="Verdana" style="font-size: 9pt" color="#FFFFFF">
            Username:</font></b></p>
            <p align="center" style="margin-top: 2; margin-bottom: 2">
            <input type="text" name="req_username" size="13" style="font-family: Georgia; font-size: 8pt; font-weight: bold"></p>
            <p align="center" style="margin-top: 2; margin-bottom: 2"><b>
            <font face="Verdana" style="font-size: 9pt" color="#FFFFFF">
            Password:</font></b></p>
            <p align="center" style="margin-top: 2; margin-bottom: 2">
            <input type="password" name="req_password"  size="13" style="font-family: Georgia; font-size: 9pt; font-weight: bold"></p>
            <p align="center" style="margin-top: -5; margin-bottom: -15">
            <input type="image" src="imgs/login.gif" name="login" value="<?php echo $lang_common['Login'] ?>" width="80" height="34" /></form>
          <?php

}

Can anyone tell me what im doing wrong? sad

**EDIT**

The "Unable to Connect to Database!!" message appears when I try posting, but if go back to the index, the post is there


thanks,
Juston

Utchin wrote:

all mods will work on 1.2.* You have to change the forum version in the mod, There is a stiky on the forum.

Look over at
http://wiki.punres.org


Thanks...

Hello,

I have a couple of questions...

1) Is there a Private Message System that will work with the current release? (1.2.20) I found one, but the download link dosent work...

Also, I have a Forum Category on my board called "news". is there a way to show these postings on the main index of my site? Currently my punbb install is in a subfolder under my docroot in my webdirectory. (Site is in /web/ and punbb is in /web/boards/)

thanks for that help as always! smile

Juston

15

(2 replies, posted in PunBB 1.2 troubleshooting)

Ahh okie, I didnt see it. Thank you so much!

16

(2 replies, posted in PunBB 1.2 troubleshooting)

Hello,

I didnt know where to post this, so I guess iim putting it here...

I created a group called "Staff Only" and I have added members of my staff to that group. Is there a way I can assign a spacific forum, lets say "Staff Only Forum" to this group so that members of this group are the only ones who can read & post in this group?

thanks in advance
Juston

I'll give it a try, thanks!

Hello. I have been browsing the forums and I haven't quite found the solution to my problem.  I have a login box on the main page of my site that logs a user into the forums. My problem is that after a user logs in, the page just refreshes and login box reappears. Is there a way I can have it say "Welcome Guest, Please login" if no one has logged in yet, and if a user is logged in it shows "Welcome [user]" and maybe under that have like a sub menu, like " Administration, Profile, Messages, Logout (if the user is an admin) or just "Profile, Messages, Logout" (if the user is not)

heres the current code im using

?php define('PUN_ROOT', 'boards/'); ?>
<?php
require PUN_ROOT.'include/common.php';
define('PUN_QUIET_VISIT', 1);
    $redirect_url = 'boards/index.php' ;
    if(isset($_SERVER['REQUEST_URI']))
        $redirect_url = $_SERVER['REQUEST_URI'] ;
 
    require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';

?>
          <form id="login" method="post" action="<?php echo PUN_ROOT.'login.php?action=in'; ?>">
            <input type="hidden" name="form_sent" value="1" />
            <input type="hidden" name="redirect_url" value="<?php echo $redirect_url ?>" />  
            <p align="center" style="margin-top: 2; margin-bottom: 2">
            <b><font face="Verdana" style="font-size: 9pt" color="#FFFFFF">
            Username:</font></b></p>
            <p align="center" style="margin-top: 2; margin-bottom: 2">
            <input type="text" name="req_username" size="13" style="font-family: Georgia; font-size: 8pt; font-weight: bold"></p>
            <p align="center" style="margin-top: 2; margin-bottom: 2"><b>
            <font face="Verdana" style="font-size: 9pt" color="#FFFFFF">
            Password:</font></b></p>
            <p align="center" style="margin-top: 2; margin-bottom: 2">
            <input type="password" name="req_password"  size="13" style="font-family: Georgia; font-size: 9pt; font-weight: bold"></p>
            <p align="center" style="margin-top: 0; margin-bottom: 0">
            <input type="image" src="img/login.gif" name="login" value="<?php echo $lang_common['Login'] ?>" />
          </form>

19

(2 replies, posted in PunBB 1.2 troubleshooting)

C'mon, anyone got any suggestions?:)

20

(2 replies, posted in PunBB 1.2 troubleshooting)

Hello. I have been browsing the forums and I haven't quite found the solution to my problem.  I have a login box on the main page of my site that logs a user into the forums. My problem is that after a user logs in, the page just refreshes and login box reappears. Is there a way I can have it say "Welcome Guest, Please login" if no one has logged in yet, and if a user is logged in it shows "Welcome [user]" and maybe under that have like a sub menu, like " Administration, Profile, Messages, Logout (if the user is an admin) or just "Profile, Messages, Logout" (if the user is not)

heres the current code im using

?php define('PUN_ROOT', 'boards/'); ?>
<?php
require PUN_ROOT.'include/common.php';
define('PUN_QUIET_VISIT', 1);
    $redirect_url = 'boards/index.php' ;
    if(isset($_SERVER['REQUEST_URI']))
        $redirect_url = $_SERVER['REQUEST_URI'] ;
 
    require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';

?>
          <form id="login" method="post" action="<?php echo PUN_ROOT.'login.php?action=in'; ?>">
            <input type="hidden" name="form_sent" value="1" />
            <input type="hidden" name="redirect_url" value="<?php echo $redirect_url ?>" />  
            <p align="center" style="margin-top: 2; margin-bottom: 2">
            <b><font face="Verdana" style="font-size: 9pt" color="#FFFFFF">
            Username:</font></b></p>
            <p align="center" style="margin-top: 2; margin-bottom: 2">
            <input type="text" name="req_username" size="13" style="font-family: Georgia; font-size: 8pt; font-weight: bold"></p>
            <p align="center" style="margin-top: 2; margin-bottom: 2"><b>
            <font face="Verdana" style="font-size: 9pt" color="#FFFFFF">
            Password:</font></b></p>
            <p align="center" style="margin-top: 2; margin-bottom: 2">
            <input type="password" name="req_password"  size="13" style="font-family: Georgia; font-size: 9pt; font-weight: bold"></p>
            <p align="center" style="margin-top: 0; margin-bottom: 0">
            <input type="image" src="img/login.gif" name="login" value="<?php echo $lang_common['Login'] ?>" />
          </form>