1,501

(15 replies, posted in PunBB 1.2 troubleshooting)

$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,502

(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

(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

http://punbb.org/forums/viewtopic.php?id=5532

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

(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

(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

(7 replies, posted in PunBB 1.2 troubleshooting)

I believe they will always show for admins

In the administration panel there is a maintenance option that lets you rebuild the search cache.

1,510

(5 replies, posted in Programming)

You can also call a script through the webserver via fsockopen.
However, again, those are not real multi-threading tongue

1,511

(5 replies, posted in Programming)

Not natively, PHP doesn't support multi-threading.

Redfield wrote:
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

(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

(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.

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

(26 replies, posted in PunBB 1.2 discussion)

Mmm, notice how it doesn't point to the same server? tongue

1,517

(24 replies, posted in PunBB 1.2 troubleshooting)

I edited it, it's now no longer missing a return statement

1,518

(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

(24 replies, posted in PunBB 1.2 troubleshooting)

xsdmx wrote:

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

(24 replies, posted in PunBB 1.2 troubleshooting)

Some of them do wink
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

(24 replies, posted in PunBB 1.2 troubleshooting)

Look at the post after?

1,522

(24 replies, posted in PunBB 1.2 troubleshooting)

Search PunRes for lightbox

Matt: I think you confused implode with explode wink
Peter: Don't worry about it, I'm glad we found a solution wink

<?
// 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.

Peter: the code you just posted does almost EXACTLY what I told you to do. tongue
I'll write up a version that works, one second wink