thanks alot rickard smile the code was successful!

this would work on default? ill give it a try to see how it goes smile thanks in advance.

Umm hello im just wondering if any of you guys could possibly help me out by telling how i could sort the top forums by adding the number of topics and the number of posts in a db query.

I think i got a hunch would you simply do this?

ORDER by num_posts AND num_topics

could you possibly do it that way? I want to be sure.

129

(9 replies, posted in PunBB 1.2 discussion)

This didnt fit in any of the other boards so i decided to post it in here. If you feel that there is a more suitable board for this topic then feel more than free to move it to the designated location. wink sorry if i have caused any trouble.

Just wanted to share this with you guys. If you are currently using the punbb miniportal located in the punres wiki then you may want to use this?

the main modification that this was built for can be located here: http://www.wiki.punres.org/Miniportal


create a new file under include/user and name it login.php

now apply this code to the file login.php:

<?php

// Show login if not logged in
if($pun_user['is_guest'])
{
    if(!isset($focus_element) || (isset($focus_element) && !in_array('login', $focus_element)))
    {odificat

    // Load the language files
    require PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';
    require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';

    // Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to index.php after login)
    $redirect_url = (isset($_SERVER['HTTP_REFERER']) && preg_match('#^'.preg_quote($pun_config['o_base_url']).'/(.*?)\.php#i', $_SERVER['HTTP_REFERER'])) ? htmlspecialchars($_SERVER['HTTP_REFERER']) : 'index.php';

    $required_fields = array('req_username' => $lang_common['Username'], 'req_password' => $lang_common['Password']);

?>
                  <div class="block">
<h2><span>Login</span></h2>
<div id="login" class="box">
<div class="inbox">             
        <div class="logintop">
            <form id="login" name="login" name="qpost" method="post" action="login.php?action=in" onsubmit="return process_form(this)">
<div style="text-align: center" class="inform">







                <p>
                    <input type="hidden" name="form_sent" value="1" />
                    <input type="hidden" name="redirect_url" value="<?php echo $redirect_url ?>" />
                     <?php echo $lang_common['Username'] ?><br />
                    <input type="text" name="req_username" size="16" maxlength="25" /><br /><br />
                     <?php echo $lang_common['Password'] ?><br />
 
 <input type="password" name="req_password" size="16" maxlength="16" wrap="virtual" onkeypress="if(event.keyCode==13) document.login.submit()" /><br /><br />
<input type="submit" name="login" value="<?php echo $lang_common['Login'] ?>" tabindex="3" /><br /><br />
                    <a href="register.php"><?php echo 'Register Now!'; ?></a>
                </p>

</div>
            </form>
        </div>
</div>
</div>
</div>
<?php
    }
}

Once you have done that all you have to do is call for it in the tpl file so open up the tpl file that handles your punbb miniportal and simply place:

<pun_include "login.php">

Somewhere along the sidebar. Once you have done that then your ready to go. The block will only be displayed for guests.

you may want to adjust your css at the top of the tpl file as well to suit the sidebar with this modification.

130

(10 replies, posted in PunBB 1.2 troubleshooting)

yeah thats relatively simple.....i still dont see why it works that way seeing as how its saying if pun user group id is greater than PUN_MOD....in this case the ">" means less than?

i believe that the topics rating should have its own coloum in viewforum.php.....it would make everything less confusing.

look the admin plugin for the chatbox and play around with the code and im sure you will eventually figure out how to remove the ip and the chatbox posts tongue

by contents you mean the posts right? Correct me if im wrong but you would probably have to do this through the database with this modification.

Sorry about the other release it was invalid and had tons of errors so i figured i would make a new topic for this release to str8en things out.

##
##
##            Mod title:  PunBB Newsbox     
##
##      Mod version:  1.0     
##   Works on PunBB: 1.2.x    
##     Release date:     
##           Author:  Justin Roy (omgtubbyomg@aim.com)     
##
##      Description:  The punbb newsbox was created to make it easier for punbb forums to display there latest news on the punbb index. This modification simply   
##                          adds a block to the index that is fully customizable through certain files.     
##
##  Difference with
## previous version:  First Release
##
##   Affected files:  profile.php, index.php     
##
##       Affects DB:  Yes     
##
##            Notes:  Please do not forget to check the readme for the process of the installation. It is important that you follow the instructions to the core.    
##
##       DISCLAIMER:      Please note that "mods" are not officially supported by
##                                 PunBB. Installation of this modification is done at your
##                                 own risk. Backup your forum database and any and all
##                                 applicable files before proceeding.
##
##
##

Download Here

Demo Here ( Read the announcement )

sorry for not updating the link as i deleted the first project and created a new one cause some things were messed up( not with the mod ).

yeah i would like to know this as well tongue out of curiosity cause it happened to me too.

Im sorry but this modification is not yet ready for a release.....i hadnt been aware of this until one of my users reported the error to me. Until i fix this error i will not be releasing this modification. Sorry for any inconvenience or confusion.

138

(6 replies, posted in PunBB 1.2 troubleshooting)

thanks alot pogenwurst......iam always missing the smallest modifications for some reason tongue

139

(6 replies, posted in PunBB 1.2 troubleshooting)

anyone have any suggestions for me?

140

(6 replies, posted in PunBB 1.2 troubleshooting)

bump

141

(6 replies, posted in PunBB 1.2 troubleshooting)

ok i can now get the checkbox to stay checked but for some reason its not changing anything even if you save it...heres is my news.php file stored in my "users" folder. How could i modify this so that it refers to the checkbox in profile.php.....as you can see i have already given it an attempt. Im wondering if i have to call for anything in the database?

<?php
if ($pun_user['g_id'] < PUN_GUEST)
{
?>
<?
if ($user['show_newsbox'] != '1')
{
?>
<div class="block" style="margin-left: 8px; margin-right: 8px; margin-bottom: 8px; margin-top: 8px">
<h2><span><a href="viewforum.php?id=1">News and Updates</a></span></h2>
<div class="box" style="height: 145px; overflow: auto">
<div class="inbox">
<?php
include('http://www.fatalgamers.org/forums/extern.php?action=news&fid=1');
?>
</div>
</div>
</div>
<?
}
?>
<?
}
?>

142

(6 replies, posted in PunBB 1.2 troubleshooting)

well im currently creating a new checkbox in profile.php under display. What this checkbox is for is the display of my newsbox on my forum index.

So far i have created a new feild under the users table and named it "show_newsbox" and then i set it up in profile.php., but it seems that it doesnt stick to the default value nor switch to a different value when checked......in other words you cant check the box.....is there any suggestions for this?

This is the checkbox i stored in profile.php jsut after the show_img checkbox

<label><input type="checkbox" name="form[show_newsbox]" value="1"<?php if ($user['show_newsbox'] == '1') echo ' checked="checked"' ?> /><?php echo 'Show Newsbox'; ?><br /></label>

Here is the line that collects it from the database. Look for u.show_newsbox

$result = $db->query('SELECT u.id, u.username, u.email, u.title, u.realname, u.url, u.jabber, u.icq, u.msn, u.aim, u.yahoo, u.location, u.use_avatar, u.signature, u.disp_topics, u.disp_posts, u.email_setting, u.save_pass, u.notify_with_post, u.notify_mp, u.use_pm, u.popup_pm, u.show_smilies, u.show_img, u.show_newsbox,  u.show_img_sig, u.show_avatars, u.show_sig, u.timezone, u.style, u.num_posts, u.last_post, u.registered, u.registration_ip, u.admin_note, g.g_id, g.g_user_title, g.g_color FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());

143

(4 replies, posted in PunBB 1.2 discussion)

ok i see where your coming from ......so i guess the word "topic" would be a better choice in the long run.

144

(4 replies, posted in PunBB 1.2 discussion)

well there are certain forum softwares that do in fact use "Threads".

oh yeah just to ask you guys.......what is the point in styling or even having #main in the css setup? I would like to know this smile

yes the #left is the block.....

#left {
        width: 120px;
        float: left;
        text-align: left
    }

Try something like that and see what you get. Im pretty sure it will stylize it for you.

If not you will have to look in to header.php and edit some code that deals with the <pun_status>

It would be relatively simple either way. its nothing complicated.

To be honest.....if i were you i would do exactly what pogenwurst had mentioned. it is probably the cleanest way to follow through with this.

147

(4 replies, posted in PunBB 1.2 discussion)

Well in my opinion( not too sure about what others want..wich is why i made this topic smile ) , "Topics" should be known as "Threads" for punbb 1.3

What do you guys think?

Its not much of a big deal but "Threads" seems to sound alot better for some reason.

148

(8 replies, posted in Programming)

wow thanks guys.....at the moment iam using pogenwursts cause it seems to be working just fine for me. As for elbekko thanks alot!

149

(8 replies, posted in Programming)

i would like to show all affliates that there are on the page but shuffle them around.

150

(8 replies, posted in Programming)

Ok atm iam trying to code something very simple. It may seem like a no-brainer to some of you php coders out there ;P

so far iam creating affliates.php

here it is

<div class="block">
<h2><span><?php echo 'Affliates'; ?></span></h2>
<div class="box" id="announce">
<div class="inbox">
<?php

$affliates = '<a href="#">'.pun_htmlspecialchars('Link 1').'<br /> <a href="#">'.pun_htmlspecialchars('Link 2').'</a></a>';

echo $affliates;

?>
</div>
</div>
</div>

Thats it so far. Iam placing this file in the "users" folder and including it through the main.tpl template.

Iam trying to shuffle these links. How would i go about doing this? Could i use the str_shuffle function?