201

(10 replies, posted in PunBB 1.4 troubleshooting)

And you put everything in your /forum/include/user/header_filename.php properly?
Note that

<!-- forum_include

should be somewhere inside <body> tag of your main.tpl.

EDIT
Oh, I've checked it. Seems that it doesn't work on Oxygen sad. It gets tpl files from /include/template folder by default. However you shouldn't edit this files. It would be better if you copy Oxygen folder, name it e.g. Oxygen2, then rename Oxygen.php to Oxygen2.php and edit $forum_loader line to

$forum_loader->add_css($base_url.'/style/Oxygen2/min/Oxygen2.min.css', array('type' => 'url', 'group' => FORUM_CSS_GROUP_SYSTEM, 'media' => 'screen'));

Then rename /style/Oxygen2/min/Oxygen.min.css to /style/Oxygen2/min/Oxygen2.min.css, set it to your default forum style and then put there main.tpl and admin.tpl smile.

202

(10 replies, posted in PunBB 1.4 troubleshooting)

You understood perfectly smile.

203

(10 replies, posted in PunBB 1.4 troubleshooting)

Nope. You have to put main.tpl admin.tpl to the /style/your_style folder in your forum directory. Then restyle it to look like this one from root site. Probably add

<!-- forum_include "header.php" -->

in the proper place of DOM tree. However header.php ( i don't know whether it could has got any other extension ) should be copied to forum/include/user folder.

This is perhaps the simplest way.

204

(10 replies, posted in PunBB 1.4 troubleshooting)

Copy main.tpl and admin.tpl from /include/template to your style folder and simply edit this files. You can include files there by putting

<!-- forum_include "file_name.php" -->

Where file_name.php should be in /include/user/ folder. CSS should be contained at the end of your style/style_name/min/style_name.min.css file.

Could you show us the part of your CSS which you've changed? Or at least adress to your forum smile.

206

(11 replies, posted in News)

Could you possibly send my an address?

207

(11 replies, posted in News)

Firsty you have to add your code at the end of the min/Oxygen.min.css and also You'll need to use code

body{background-image: url('../img/background3.jpg); }

or place img folder in your min/ folder. This is because style is generated from this min file.

208

(71 replies, posted in PunBB 1.4 additions)

Sorry it's just my bad habit.
So, this is the correct ( i hope ) version of urban_1.php

<?php
    switch ($forum_user['avatar']['type'])
    {
        case FORUM_AVATAR_GIF:
            $avatar_filename = $forum_user['id'].'.gif';
            break;

        case FORUM_AVATAR_JPG:
            $avatar_filename = $forum_user['id'].'.jpg';
            break;

        case FORUM_AVATAR_PNG:
            $avatar_filename = $forum_user['id'].'.png';
            break;

        case FORUM_AVATAR_NONE:
            $noavatar = TRUE;
            break;
        default:
            $noavatar = TRUE;
            break;
    }
?>
<?php if($noavatar != TRUE) { ?>
<a href="<?php echo($base_url); ?>/profile.php?id=<?php echo($forum_user['id']); ?>"><img src="<?php echo($base_url); ?>/<?php echo($forum_config['o_avatars_dir']); ?>/<?php echo($avatar_filename); ?>" id="topavatar"/></a>
<?php } ?>

Pack has been reuploaded.

209

(71 replies, posted in PunBB 1.4 additions)

I'm sorry, I'm still new, so I can hardly understand many things. I've just checked functions.php and made something like this, is it all right?

<?php
    switch ($forum_user['avatar']['type'])
    {
        case FORUM_AVATAR_GIF:
            $avatar_filename = $forum_user['id'].'.gif';
            break;

        case FORUM_AVATAR_JPG:
            $avatar_filename = $forum_user['id'].'.jpg';
            break;

        case FORUM_AVATAR_PNG:
            $avatar_filename = $forum_user['id'].'.png';
            break;

        case FORUM_AVATAR_NONE:
            $noavatar = TRUE;
            break;
        default:
            $noavatar = TRUE;
            break;
    }
?>
<? if($noavatar != TRUE) { ?>
<a href="<?php echo($base_url); ?>/profile.php?id=<?php echo($forum_user['id']); ?>"><img src="<?php echo($base_url); ?>/<?php echo($forum_config['o_avatars_dir']); ?>/<?php echo($avatar_filename); ?>" id="topavatar"/></a>
<? } ?>

210

(71 replies, posted in PunBB 1.4 additions)

Well, perhaps it was problem with shorttags, but I don't understand how that line

<div class="main-head"><h2 class="hn"><span class="item-info"><?php $lang_topic['Quick post'] ?></span></div>

works, if there isn't echo to display variable. I've reuploaded the file, if you're using it already this are the changes to include files.
urban_1.php

<?php if($forum_user['avatar']['type'] == 1){ ?>
<a href="<?php echo($base_url); ?>/profile.php?id=<?php echo($forum_user['id']); ?>"><img src="<?php echo($base_url); ?>/<?php echo($forum_config['o_avatars_dir']); ?>/<?php echo($forum_user['id']) ?>.gif" id="topavatar"/></a>
<?php } else if($forum_user['avatar']['type'] == 2) { ?>
<a href="<?php echo($base_url); ?>/profile.php?id=<?php echo($forum_user['id']); ?>"><img src="<?php echo($base_url); ?>/<?php echo($forum_config['o_avatars_dir']); ?>/<?php echo($forum_user['id']) ?>.jpg" id="topavatar"/></a>
<?php } else if($forum_user['avatar']['type'] == 3) { ?>
<a href="<?php echo($base_url); ?>/profile.php?id=<?php echo($forum_user['id']); ?>"><img src="<?php echo($base_url); ?>/<?php echo($forum_config['o_avatars_dir']); ?>/<?php echo($forum_user['id']) ?>.png" id="topavatar"/></a>
<?php } ?>

urban_2.php

<?php if (FORUM_PAGE == 'viewtopic') { ?>
<div class="main-head"><h2 class="hn"><span class="item-info"><?php echo($lang_topic['Quick post']); ?></span></div>
<?php } //if it is viewtopic, we display header ?>

urban_3.php

<?php if (FORUM_PAGE == 'index') {
?>
    <div id="brd-visit" class="gen-content">
        <!-- forum_visit -->
    </div>
<?php
} //if it is index, we display header links e.g. "new posts" ?>

You can edit this extension http://punbb.informer.com/forums/topic/ … le-fields/

http://punbb.informer.com/forums/post/142228/#p142228

213

(71 replies, posted in PunBB 1.4 additions)

:: Information
Theme Urban, ver. 1.3
Again - theme is using a lot of CSS3. It should work properly on Chrome, Firefox and probably newest IE. Dunno about Safari. It's also compatible with IE6/7 ( without CSS3 effects ).

:: Authors
It was made by me, basing on Oxygen theme. I've used Iconic icon set ( under CC license ). Header is using Open-sans font.

:: License
http://i.creativecommons.org/l/by-sa/3.0/88x31.png
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

:: Instalation
1)Extract /styles/Urban to your /styles folder.
2)Extract files from /include/user/ to your /include/user/ folder! It's necessary for theme to work properly! It provides this features:

  • urban_1.php
    http://i.minus.com/ibvCvfb8MYcHXj.jpg
    Displaying avatar.

  • urban_2.php
    http://i.minus.com/ibjwVomdryudmD.jpg
    Change the way of displaying Quick reply header.

  • urban_3.php
    It displays options such as New posts, Active posts, etc. only on index page

3)If you're using pun_bbcode extension you may also upload /extensions/pun_bbcode/css/Urban to your /extensions/pun_bbcode/css/ folder.

:: Screenshoots and features
http://i.minus.com/jKt152zi4CpTG.jpg
Index
http://i.minus.com/jCRZo4mAFK2PB.jpg
Viewforum
http://i.minus.com/jbsWISlRFSj8wE.jpg
Viewtopic
http://i.minus.com/j4voWJPmAo1kM.jpg
Profile ( note: Google Map is mine extentions, it's not provided by a theme )
http://i.minus.com/jR9eraFpulhfy.jpg
Administration

:: Demo
http://kushithemes.t15.org/
login: Urban
password: demo

:: Download
https://dl.dropbox.com/u/82283017/punbb/9-av-download.png

Hell yeah, thank You smile!

Hello! I'm creating a new theme and I made some changes to the template which require including some files. Therefore I need to check if it is index.php. I figured it somehow

$adress  = $_SERVER["REQUEST_URI"]; //checking current adress
$part= explode("?", $adress  ); //exploding string into 2 parts, divided by a '?' sign -
 if ($part[0] == '/index.php' || $part[0] == '/') {
echo('
    <div id="brd-visit" class="gen-content">
        <!-- forum_visit -->
    </div>
');

and the same thing with viewtopic.php

<?
$adres  = $_SERVER["REQUEST_URI"];
$czesc = explode("?", $adres); 
 if ($czesc[0] == '/viewtopic.php') {
echo('<div class="main-head"><h2 class="hn"><span class="item-info">'.$lang_topic['Quick post'].'</span></div>');
}
?>

however it would only work with default URL scheme :<. And since my server doesn't support redirecting I cannot check names of this files in other schemes. Perhaps You could help me or tell some better method to check it. Please.

216

(47 replies, posted in PunBB 1.4 additions)

Yeah, it may be wrong, cause there wasn't any alerts while I was making it and simply forgot about it wink. As soon as I relase new theme I would fix this one and reupload.


EDIT

I've reuploaded theme, so it goes to ver. 0,9. I've changed the way of displaying images in buttons, re-organised DOM tree so it should display better on IE, and some other small fixes. Enjoy.

This one doesn't show, probably because You didn't choose any moderator to forums ( it can be done by selecting user -> Administration ).

Profile.php
Find

// Now check the width/height
                        if (empty($width) || empty($height) || $width > $forum_config['o_avatars_width'] || $height > $forum_config['o_avatars_height'])
                        {
                            @unlink($forum_config['o_avatars_dir'].'/'.$id.'.tmp');
                            $errors[] = sprintf($lang_profile['Too wide or high'], $forum_config['o_avatars_width'], $forum_config['o_avatars_height']);
                        }
                        else if ($type == 1 && $uploaded_file['type'] != 'image/gif')    // Prevent dodgy uploads
                        {
                            @unlink($forum_config['o_avatars_dir'].'/'.$id.'.tmp');
                            $errors[] = $lang_profile['Bad type'];
                        }

Replace by

// Now check the width/height
            list($width, $height, $type,) = getimagesize($base_url.'/'.$forum_config['o_avatars_dir'].'/'.$id.'.tmp');
            if (empty($width) || empty($height) || $width > $forum_config['o_avatars_width'] || $height > $forum_config['o_avatars_height'])
            {

                // Attempt to resize if GD is installed with support for the uploaded image type, as well as JPG for the output
                $check_type = str_replace(array(1, 2, 3), array('IMG_GIF', 'IMG_JPG', 'IMG_PNG'), $type);
                if (extension_loaded('gd') && imagetypes() & constant($check_type) && imagetypes() & IMG_JPG)
                {

                    // Load the image for processing
                    if ($type == 1) $src_img = @imagecreatefromgif($base_url.'/'.$forum_config['o_avatars_dir'].'/'.$id.'.tmp');
                    elseif ($type == 2) $src_img = @imagecreatefromjpeg($base_url.'/'.$forum_config['o_avatars_dir'].'/'.$id.'.tmp');
                    elseif ($type == 3) $src_img = @imagecreatefrompng($base_url.'/'.$forum_config['o_avatars_dir'].'/'.$id.'.tmp');

                    if ($src_img)
                    {

                        // Figure out new image dimensions based on the maximum width
                        $new_w = $forum_config['o_avatars_width'];
                        $ratio = $height * $new_w;
                        $new_h = $ratio / $width;

                        // Do the new dimensions, based on the maximum width, fit the maximum height? If not, recalculate
                        if ($new_h > $forum_config['o_avatars_height'])
                        {
                            $new_h = $forum_config['o_avatars_height'];
                            $ratio = $width * $new_h;
                            $new_w = $ratio / $height;
                        }

                        // Resize the image
                        $new_img = imagecreatetruecolor($new_w, $new_h);
                        imagecopyresampled($new_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, $width, $height);

                        // Delete the old image and write the newly resized one
                        @unlink($base_url.'/'.$forum_config['o_avatars_dir'].'/'.$id.'.tmp');
                        imagejpeg($new_img,$base_url.'/'.$forum_config['o_avatars_dir'].'/'.$id.'.tmp',85);

                        // Set the extension to JPG, since that's what the resized image is now
                        $extensions[0] = '.jpg';
                    }

                    // Something went wrong while attempting to load the image for processing
                    else
                    {
                        @unlink($base_url.'/'.$forum_config['o_avatars_dir'].'/'.$id.'.tmp');
                        message('An unexpected error occured while attempting to resize the image.');
                    }
                }

                // No GD installed or image type not supported; can't resize
                else
                {
                    @unlink($base_url.'/'.$forum_config['o_avatars_dir'].'/'.$id.'.tmp');
                    message($lang_profile['Too wide or high'].' '.$forum_config['o_avatars_width'].'x'.$forum_config['o_avatars_height'].' '.$lang_profile['pixels'].'.');
                }
            }
            else if ($type == 1 && $uploaded_file['type'] != 'image/gif')    // Prevent dodgy uploads
            {
                @unlink($base_url.'/'.$forum_config['o_avatars_dir'].'/'.$id.'.tmp');
                message($lang_profile['Bad type']);
            }

            // Make sure the file isn't too big
            if (filesize($base_url.'/'.$forum_config['o_avatars_dir'].'/'.$id.'.tmp') > $forum_config['o_avatars_size'])
                message($lang_profile['Too large'].' '.$forum_config['o_avatars_size'].' '.$lang_profile['bytes'].'.');

Find

// Make sure the file isn't too big
                    if ($uploaded_file['size'] > $forum_config['o_avatars_size'])
                        $errors[] = sprintf($lang_profile['Too large'], forum_number_format($forum_config['o_avatars_size']));

Delete it

include/functions.php
Find

$avatar_markup = '<img src="'.$base_url.'/'.$path.'" width="'.$avatar_width.'" height="'.$avatar_height.'" alt="'.$alt_attr.'" />';

Replace by

$avatar_markup = '<img src="'.$base_url.'/'.$path.'" alt="'.$alt_attr.'" />';

If you get

The server was unable to save the uploaded file.

error, chmod /img/avatars/ folder.

Now you set maxsize ( avatars would be resized to it ) in Settings -> Features

Aw I see error too hmm. I'll try to fix it.

edit

Well You should check this one
http://punbb.informer.com/forums/topic/ … -resizing/
I have no idea how to transform it into extension

Oh! Mea culpa - it was checking width firstly, and making some mistakes due to that. Here is version which works just like you said.

edit

And here it is,
http://min.us/lGq1Z5CZKwVvN
it displays info e.g.

Images will be resized automaticly, if they're bigger than 80x120 pixels.

which can be edited in line 64

                $forum_page['frm_info']['avatar_size'] .= '<li><span>Images will be resized automaticly, if they\'re bigger than '.$avatar_max_width.'x'.$avatar_max_height.' pixels.</span></li>';

Sorry, that i didn't make lang file, but I'm just learning.

Here is a little extension
http://min.us/lnnHYlKb6ZVl1
it would avoid resizing smaller avatars to bigger ones.
You can customize it in lines 28 and 29

        $avatar_max_width = 80;
        $avatar_max_height = 80;

No CSS changes needed - You can delete previous code. But still it wouldn't resize physically images ( it can be done but I'm not skilled enough ).

Well, there is a way.

You should off the limits ( set big ones ) in administration panel ( Settings -> Features -> Avatar max width/height ) and then add this to your's style CSS, preferably at the bottom.

.useravatar img{
    width: 80px;
    height: auto;
}

( set width according to your's will )
Warning! It does not resize images. Which means they would weight a lot if somebody uploaded some big ones. And I advise against using it. Another issue - if somebody had smaller avatar, it would show it bigger, pixelized.

223

(6 replies, posted in PunBB 1.4 additions)

Change line 37 of /extensions/pun_bbcode/manifest.xml
from

$forum_db->add_field('users', 'pun_bbcode_use_buttons', 'TINYINT(1)', false, 0);

to

$forum_db->add_field('users', 'pun_bbcode_use_buttons', 'TINYINT(1)', false, 1);

and reinstall it.

224

(47 replies, posted in PunBB 1.4 additions)

Unfortunately I do not have it. But I've tried to fix it ( it was hard, because I can't see any errors ), maybe this one will look properly
http://i.minus.com/ibvjh8Z8VHgniw.png

225

(47 replies, posted in PunBB 1.4 additions)

Come on it's 21 century, we've got fast Internet ;P.