$pun_user['is_guest'] is what you're looking for.
And yes, if you look at the query to populate $pun_user we fetch users.*, groups.*, and a couple columns from the online table.
1,501 2008-01-05 15:31
Re: Website Integration if() in PHP (15 replies, posted in PunBB 1.2 troubleshooting)
1,502 2008-01-05 12:57
Re: [1.3] URL rewrite rule: lighttpd? (10 replies, posted in PunBB 1.2 discussion)
Not on the dev team, but if you're looking to test it out, the setup should be similar to Wordpress and lighttpd
http://www.cyberciti.biz/tips/lighttpd- … -urls.html
1,503 2008-01-05 12:54
Re: Disabling post count (7 replies, posted in PunBB 1.2 troubleshooting)
if ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST)
$user_info[] = '<dd>'.$lang_common['Posts'].': '.$cur_post['num_posts'];
// Determine if we are allowed to view post counts
$show_post_count = ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST) ? true : false;
That's in your code: if it's not working right, the option is enabled
1,504 2008-01-05 04:34
Re: Posts cannot be longer that 65535 characters 64 KB (3 replies, posted in PunBB 1.2 troubleshooting)
1,505 2008-01-05 04:25
Re: Posts cannot be longer that 65535 characters 64 KB (3 replies, posted in PunBB 1.2 troubleshooting)
You would need to change the datatype of the column in the database so that it can store more data and then you would need to remove/change the restriction in post.php/edit.php.
1,506 2008-01-05 04:13
Re: Disabling post count (7 replies, posted in PunBB 1.2 troubleshooting)
Have you modified files? That's the only other thing I can think of (since I assume your cache files are being overwritten properly, you could always try deleting them)
1,507 2008-01-04 23:38
Re: A development question... (1 replies, posted in General discussion)
That approach sounds perfectly workable to me.
Another way would be to manually apply the hdiff or apply the patch file:
http://punbb.org/download/hdiff/hdiff-1 … .2.16.html
http://punbb.org/download/patch/punbb-1 … 2.16.patch
Assuming most of your tweaks are to the CSS, those are viable options as well. However, your way sounds fine.
Edit: Typo, I've been working with a bad CVS repo all day and obviously I'm still thinking about it x(
1,508 2008-01-04 22:51
Re: Disabling post count (7 replies, posted in PunBB 1.2 troubleshooting)
I believe they will always show for admins
1,509 2008-01-04 19:23
Re: Topics missing in Search results (2 replies, posted in PunBB 1.2 troubleshooting)
In the administration panel there is a maintenance option that lets you rebuild the search cache.
1,510 2008-01-04 03:05
Re: Detaching a function (5 replies, posted in Programming)
You can also call a script through the webserver via fsockopen.
However, again, those are not real multi-threading
1,511 2008-01-04 02:24
Re: Detaching a function (5 replies, posted in Programming)
Not natively, PHP doesn't support multi-threading.
1,512 2008-01-03 22:46
Re: User name limit and color variating. (4 replies, posted in PunBB 1.2 troubleshooting)
Smartys wrote:Usernames: Yes, it just involves editing the code
What exactly do I edit? Surely, it can't be difficult.
register.php, profile.php, post.php, anywhere where a username is set and strlen is used to check the length.
1,513 2008-01-03 22:35
Re: error during install (5 replies, posted in PunBB 1.2 troubleshooting)
That's the URL for your site, is that the right address for your MySQL server? If you're unsure, ask your host.
1,514 2008-01-03 22:30
Re: error during install (5 replies, posted in PunBB 1.2 troubleshooting)
Sounds like you tried to connect to a MySQL server on localhost. If the MySQL server is supposed to be on localhost, make sure that it's running. If not, you'll need to put in the correct address for the MySQL server.
1,515 2008-01-03 20:27
Re: User name limit and color variating. (4 replies, posted in PunBB 1.2 troubleshooting)
Usernames: Yes, it just involves editing the code
Alternating colors: This should help
http://shauninman.com/archive/2006/05/1 … s_in_punbb
1,516 2008-01-03 14:17
Re: The Homepage?! (26 replies, posted in PunBB 1.2 discussion)
Mmm, notice how it doesn't point to the same server?
1,517 2008-01-03 04:19
Re: View Full Size "Resized" Image (24 replies, posted in PunBB 1.2 troubleshooting)
I edited it, it's now no longer missing a return statement
1,518 2008-01-03 02:29
Re: View Full Size "Resized" Image (24 replies, posted in PunBB 1.2 troubleshooting)
//
// Turns an URL from the [img] tag into an <img> tag or a <a href...> tag
//
function handle_img_tag($url, $is_signature = false)
{
global $lang_common, $pun_config, $pun_user;
$img_tag = '<a href="'.$url.'"><'.$lang_common['Image link'].'></a>';
if ($is_signature && $pun_user['show_img_sig'] != '0')
$img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
else if (!$is_signature && $pun_user['show_img'] != '0')
{
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
$new_image = ImageCreateFromString($file_contents);
imagejpeg($new_image, "temp.jpg",100);
// Get new dimensions
$myfilesize = getimagesize("temp.jpg");
$width_orig = $myfilesize[0];
$height_orig = $myfilesize[1];
if ($myfilesize)
{
$width = $myfilesize[0];
$height = $myfilesize[1];
$img_tag = '<img class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
if ($width > 550)
{
$img_tag = '<a href="'.$url.'" rel="lightbox">' . $img_tag . '</a>';
}
}
else
{
$img_tag = '<strong>error: image ' . $url . ' cannot be loaded.</strong>';
}
}
return $img_tag;
}
1,519 2008-01-02 23:30
Re: View Full Size "Resized" Image (24 replies, posted in PunBB 1.2 troubleshooting)
It wouldn't matter anyway because he did something he didn't code down "I added curl to create temp image and get dimensions, but it was showing the thumbnails at 100% width.. so i created a new class for .limg and made it 150px wide.. so its fixed"
No idea
I don't think he used Bekko's code. Here it is, in case the link doesn't work for you:
//
// Turns an URL from the [img] tag into an <img> tag or a <a href...> tag
//
function handle_img_tag($url, $is_signature = false)
{
global $lang_common, $pun_config, $pun_user;
$img_tag = '<a href="'.$url.'"><'.$lang_common['Image link'].'></a>';
if ($is_signature && $pun_user['show_img_sig'] != '0')
$img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
else if (!$is_signature && $pun_user['show_img'] != '0')
{
$imagehw = @getimagesize($url);
if ($imagehw)
{
$width = $imagehw[0];
$height = $imagehw[1];
$img_tag = '<img class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
if ($width > 550)
{
$img_tag = '<a href="'.$url.'" rel="lightbox">' . $img_tag . '</a>';
}
}
else
{
$img_tag = '<strong>error: image ' . $url . ' cannot be loaded.</strong>';
}
}
return $img_tag;
}
1,520 2008-01-02 23:12
Re: View Full Size "Resized" Image (24 replies, posted in PunBB 1.2 troubleshooting)
Some of them do
And it looks like pastebin.ca is having some trouble right now, so that's probably why the rest don't. Try again in an hour or so.
1,521 2008-01-02 23:04
Re: View Full Size "Resized" Image (24 replies, posted in PunBB 1.2 troubleshooting)
Look at the post after?
1,522 2008-01-02 21:04
Re: View Full Size "Resized" Image (24 replies, posted in PunBB 1.2 troubleshooting)
Search PunRes for lightbox
1,523 2008-01-02 16:21
Re: RSS feeds from database + associated data (skip NULL in MySQL output) (92 replies, posted in Programming)
Matt: I think you confused implode with explode
Peter: Don't worry about it, I'm glad we found a solution
1,524 2008-01-02 15:44
Re: RSS feeds from database + associated data (skip NULL in MySQL output) (92 replies, posted in Programming)
<?
// Include the SimplePie library
require_once 'simplepie.inc';
require 'shorten.php';
// Because we're using multiple feeds, let's just set the headers here.
header('Content-type:text/html; charset=utf-8');
// These are the feeds we want to use
mysql_connect(localhost,$db_username,$db_password);
@mysql_select_db($db_name) or die( "Unable to select database");
$query="SELECT id, firstname, rssfeed FROM members WHERE rssfeed!=''";
$result=mysql_query($query);
$feeds = array();
while ($cur_feed = mysql_fetch_assoc($result))
$feeds[] = $cur_feed['rssfeed'];
// This array will hold the items we'll be grabbing.
$first_items = array();
// Let's go through the array, feed by feed, and store the items we want.
foreach ($feeds as $url)
{
// Use the long syntax
$feed = new SimplePie();
$feed->set_feed_url($url);
$feed->init();
// How many items per feed should we try to grab?
$items_per_feed = 1;
// As long as we're not trying to grab more items than the feed has, go through them one by one and add them to the array.
for ($x = 0; $x < $feed->get_item_quantity($items_per_feed); $x++)
{
$first_items[] = $feed->get_item($x);
}
// We're done with this feed, so let's release some memory.
unset($feed);
}
// We need to sort the items by date with a user-defined sorting function. Since usort() won't accept "SimplePie::sort_items", we need to wrap it in a new function.
function sort_items($a, $b)
{
return SimplePie::sort_items($a, $b);
}
// Now we can sort $first_items with our custom sorting function.
usort($first_items, "sort_items");
// Begin the (X)HTML page.
?>
<?php
$counter=0;
foreach($first_items as $item):
$feed = $item->get_feed();
$counter++;
if($counter>=6){
break;
}
?>
<p>
<strong><a href="<? echo $item->get_permalink(); ?>" target="_blank"><? echo $item->get_title(); ?></strong><br />
<?php unset($feed); ?>
<? echo trim(substr((str_replace("\n", ' ', str_replace("\r", ' ', strip_tags($item->get_description())))),0,80)); ?>
... <i>more</i></a><br />
</p>
<?php
endforeach;
?>
There, that should work based on what you just gave me.
1,525 2008-01-02 15:42
Re: RSS feeds from database + associated data (skip NULL in MySQL output) (92 replies, posted in Programming)
Peter: the code you just posted does almost EXACTLY what I told you to do.
I'll write up a version that works, one second