Alright, so create a file, dunno, setstyle.php or something.. it will set up a cookie.
      <OPTION value="green">Style1</OPTION>
      <OPTION value="pink">Style2</OPTION>
set those options to whatever you want, add some what ever..

<?php
$action = isset($_GET['action']);

if (!$action) {

$action = "";

}

else {

$action = $_GET['action'];

}

if (!$action) {
?>
<FORM action="<?php print ($PHP_SELF); ?>?action=setstyle" method="post">
   <P>
   <SELECT name="styledrop">
      <OPTION value="green">Style1</OPTION>
      <OPTION value="pink">Style2</OPTION>
   </SELECT>
   <INPUT type="submit" value="Send">
   </P>
</FORM>
<?php
}

if ($action) {
$style = $_GET['styledrop'];
}

if ($action == 'setstyle') {
$now = time();
setcookie(style, $now + 31536000, $style); //expires in a year..
echo 'Thank you, your design has been chosen!';
}

if ($action && $action != 'setstyle') {
echo 'Invalid Action!';
}
?>

Then, in header.php:

<?php
//Default Style:
if (!$_COOKIE["style"]) {
$styletest = "black";
}
//If cookie is set, get information:
if ($_COOKIE["style"]) {
$styletest = $_COOKIE["style"];
}
?>

then well.. <style bla bla
<?php echo $styletest.'.css'; ?>
</style>


Now, it should work, haven't tested the script heavily though it should work. You might need to do a little modifications though.

Would that be for registered users and guests or only guests?
Once I get this question answered, I'll be able to make it.

No problem faax, if you really want the commas between usernames, just create an array and use the implode() function..

Have fun with this script smile

Here you go:

<!--- "Top 20 most active users" Script by ultime (ultime@omgultime.com) created for PunBB --->
<div id="announce" class="block">
    <h2><span><b>Top 20 most active users</b></span></h2>
    <div class="box">
        <div class="inbox">
            <div>
<?php

$result = $db->query('SELECT id, username, num_posts FROM '.$db->prefix.'users ORDER BY num_posts DESC LIMIT 20') or error('Unable to fetch user data', __FILE__, __LINE__, $db->error());
while ($data = $db->fetch_assoc($result))
{
echo "\t\t\t\t\t\t".'<a href="profile.php?id='.$data['id'].'">'.pun_htmlspecialchars($data['username']).'</a>('.$data['num_posts'].') '."\n";
}

?>
        </div>
    </div>
</div>
</div>
<!--- End for "Top 20 most active users" --->

For an example, go to www.cash4posts.com and scroll down a little..

As soon as I come back from work, I'll make this small update for you!
It's really quite simple to create..

Only help I can give you is to open both viewtopic.php and viewforum.php and change index.php for forums.php.
Then open header.php and where it says something like:

array('index.php', 'search.php')

change it for:

array('index.php', 'search.php', 'forum.php')

I think that's about all the changes you really need to do, I might be missing something though..

57

(7 replies, posted in PunBB 1.2 discussion)

Warning: main(include/common.php): failed to open stream: No such file or directory in /home2/cash/public_html/folder/index.php on line 3

Warning: main(include/common.php): failed to open stream: No such file or directory in /home2/cash/public_html/folder/index.php on line 3

Fatal error: main(): Failed opening required 'include/common.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/cash/public_html/1daily/index.php on line 3

58

(7 replies, posted in PunBB 1.2 discussion)

Smartys wrote:

define('PUN_ROOT', '../');

I tried that, but it's still not working..
Do I need to change anything else?

59

(7 replies, posted in PunBB 1.2 discussion)

I need a little help with define('PUN_ROOT', './');

Lets say I make a new folder in my forums folder, I need to change the PUN_ROOT.
For example:
www.forums.com/forums = define('PUN_ROOT', './');
www.forums.com/forums/folder = ?

What would I need to change the PUN_ROOT so it sees all the files in the down folder?

Thanks in advance!

Well there is an easy way to do it.
Open up register.php
find

<label><strong><?php echo $lang_common['Username'] ?></strong><br /><input type="text" name="req_username" size="25" maxlength="25" /><br /></label>

and replace with:

<label><strong><?php echo $lang_common['Username'] ?></strong><br /><input type="text" name="req_username" size="12" maxlength="12" /><br /></label>

That would be enough, but if you want to get a little fancy, you can change some other things, though this should be enough for what you're looking for.

Very nice Mod, definatly a must-have for displaying announcement.
One question, will it accept html? I didn't try it yet, couldn't know smile

This Mod was built in PunBB 1.2.5 but should work in most versions, it can be easily modified.
I noticed PunBB wasn't putting commas in the right spot, so I decided to do a little Modification.

For example, if the forums has "5098" posts in total, PunBB will display "5098". With these modifications it will display "5,098".
Please take note that not all servers support the number_format(); command, backup before making any modifications.
Interesting so far?

Alright so open up index.php and search for:

<div id="brdstats" class="block">
<h2><span><?php echo $lang_index['Board info'] ?></span></h2>

Right over, add:

<?php
$total_users = number_format($stats['total_users']);
$total_topics = number_format($stats['total_topics']);
$total_posts = number_format($stats['total_posts']);
?>

Now, find:

<dd><?php echo $lang_index['No of users'].': <strong>'. $stats['total_users'] ?></strong></dd>
<dd><?php echo $lang_index['No of topics'].': <strong>'.$stats['total_topics'] ?></strong></dd>
<dd><?php echo $lang_index['No of posts'].': <strong>'.$stats['total_posts'] ?></strong></dd>

And replace with:

<dd><?php echo $lang_index['No of users'].': <strong>'. $total_users ?></strong></dd>
<dd><?php echo $lang_index['No of topics'].': <strong>'.$total_topics ?></strong></dd>
<dd><?php echo $lang_index['No of posts'].': <strong>'.$total_posts ?></strong></dd>

Here we go that's it! You can do the same thing in viewtopic for posts of users.

Footers look much more interesting now heh?

Now, if any french coders are around here, the right french display would be "5 098" and not "5098" or "5,098".
In order to do that you would need to use the following:

<?php
$total_users = number_format($stats['total_users'], 0, ',', ' ');
$total_topics = number_format($stats['total_topics'], 0, ',', ' ');
$total_posts = number_format($stats['total_posts'], 0, ',', ' ');
?>

- ultime

mantasman wrote:

hi, could anyone make "money" mod for punBB 1.2.5?
this mod should do something like:
1. then user post, he get some points/EUR/USD for it. e.g. 0.1 per word + 5 per post.
2. user could give these points to another user.
3. I (admin) could minus some points
or just something like(only main features need, no loteries etc.: http://www.phpbb.com/phpBB/viewtopic.php?t=94055

sorry for bad english

This could be extremelly fun, maybe I would be able to do something like this, I'll see what I can do..

This could be done very easily, if you give me a little more information, I will do it for you.
-How much money points to give?
-Hiscores?
So on.. please be as descriptive as possible.

Hello,

I have tried to add new fields to my registration, for example, to gather gender, age, ect.

Now, I have added the following after the timezone part:

<div class="inform">
<fieldset>
<legend>Choose your Gender</legend>
<div class="infldset">
<label>
<select id="gender" name="gender">
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
</div>
</fieldset>
</div>

I found this:

    $timezone = intval($_POST['timezone']);

and added the following right after:

    $gender = isset($_POST['gender']);

I have also modified my sql query from:

    $db->query('INSERT INTO '.$db->prefix.'users (username, group_id, password, email, email_setting, save_pass, timezone, faction, language, style, registered, registration_ip, last_visit) VALUES(\''.$db->escape($username).'\', '.$intial_group_id.', \''.$password_hash.'\', \''.$email1.'\', '.$email_setting.', '.$save_pass.', '.$timezone.', '.$faction.', \''.$db->escape($language).'\', \''.$pun_config['o_default_style'].'\', '.$now.', \''.get_remote_address().'\', '.$now.')') or error('Unable to create user', __FILE__, __LINE__, $db->error());

To:

    $db->query('INSERT INTO '.$db->prefix.'users (username, group_id, password, email, email_setting, save_pass, timezone, faction, language, style, registered, registration_ip, last_visit, gender) VALUES(\''.$db->escape($username).'\', '.$intial_group_id.', \''.$password_hash.'\', \''.$email1.'\', '.$email_setting.', '.$save_pass.', '.$timezone.', '.$faction.', \''.$db->escape($language).'\', \''.$pun_config['o_default_style'].'\', '.$now.', \''.get_remote_address().'\', '.$now.', '.$gender.')') or error('Unable to create user', __FILE__, __LINE__, $db->error());

My SQL for gender is:

Varchar(50)

Can anyone please tell me how to do this in easy to follow steps, I really have tried everything I could..

Thanks, ultime

erissiva wrote:

Um...
I admit that it's pretty cool what you've done, but is this a useable mod?

Unless, of course - it was changed to something far more fun...Like PunSlaps.
No, no...


Couldn't this be a way for people to overload your system?

I doubt a server could get overloaded like this, since the page is under 1kb, I got the idea from the "Bear hug" thingy, you need to press then button and it hugs the bear, and hmm yeah I guess its a useable mod, no point in using it  though, unless you want more hits with your google ads, that was my main idea hehe.. PunSlaps could be done also lol.

Just a little simple mod.

When my server is up, you can view the demo here: http://ultime.2mydns.com/hugs.php

MYSQL Changes:

ALTER TABLE `users` ADD `hugs` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL AFTER `style` ;

Extract and upload the following file, www.omgultime.com/punhugz.zip

This script will count hugs done by every users, and display the total ammount of hugs on the forums.

Enjoy and have fun with it!

- ultime

68

(18 replies, posted in News)

Thats very impressive, well done, I like the randomizing skin button!

69

(12 replies, posted in Programming)

shinko_metsuo wrote:

get it to change " to " when parsing.

How could this be done?

70

(12 replies, posted in Programming)

I have added "htmlspecialchars" but I have no idea how to really use them.. Not sure if it fixed the problem.

71

(12 replies, posted in Programming)

Hello everyone,

I decided to make some random site today, here's the result.
http://www.omgultime.com/

Here's an example of what is creates:
http://www.omgultime.com/archives.php?id=43

Here's the questions:
When there is " in the textarea, it comes up with an error on the next screen, try it for yourself if you don't understand.
http://www.omgultime.com/create.php

Anyone would know how to fix this?

Thanks!
-ultime

72

(1,382 replies, posted in General discussion)

all wrong

This gave me a good laugh, enjoy!

http://bbspot.com/News/2000/6/php_suspend.html

74

(3 replies, posted in General discussion)

Hey guys,

I just signed up on ebay, and here's my first item.

http://cgi.ebay.ca/ws/eBayISAPI.dll?Vie … 5567031820

It's a joke of course, I wanna see how many hits this page can have, and actually how high people will  be ready to bid on this.

Enjoy!

- ultime

cows wrote:

ultima

is this really stable yet???

Please use the following version, it should be a bit more stable.

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