1 (edited by sPuD 2005-08-04 16:57)

Topic: My Metal forum, and Anime forum too! [Image heavy]

Recently I've been working on a new metal forum I plan to open up. It's still under construction so all you get to see is the maintenance page, here: http://tenkai.net/metal

However, I do have some screenshots of what I've done to it (I'm proud of it, being new to php).

Installed Mods:

Private Messages
Spoiler tags (my own)
Store/Points system (my own)
Post Icons (my own)

http://img183.imageshack.us/img183/1503/screen16xq.gif
An example of my post icons mod, which adds post icons to topics (kind of like the smilies that some forums use). Also you can see some information about my store/points system (kill two birds with one stone).

http://img272.imageshack.us/img272/4184/screen29uc8kh.gif
On the left you can see how many points I have!! Ooohh big_smile (Being an admin I can edit anyone's points from their Profile). If I was to click the $ inside the ($), it would direct me to the store so that I could buy something for that user/donate.

http://img110.imageshack.us/img110/4084/screen39np.gif
See those post icons in action! Currently displaying an Important tag for a sticky and tags for the genre of the metal album covered in each topic.

http://img110.imageshack.us/img110/2472/screen44qv.gif
The store page! At the moment only a few things can be done, but in the future maybe I'll think up more features!

And as for the anime site, I have an anime forum, though it's dead now, and I plan to shut it down soon. http://forums.tenkai.net

The only downside to me writing my own mods is that I'm new to php and I probably have opened up my forums to the first hacker who comes my way.

Re: My Metal forum, and Anime forum too! [Image heavy]

Could you possibly make a mod for the post icons? I have always wanted post icons on punbb, but I have no clue on how to write the mod. Also, your forum looks really nice.

3

Re: My Metal forum, and Anime forum too! [Image heavy]

I could give you the code to do it, but I probably won't release an official mod. You'd just have to modify an array pretty much, and make your icons (mine are being made specifically for my forum by someone else, who's not yet done as you may of noticed from that screenshot above). Also I can't guarantee that it'll be secure, as I'm not too experienced in PHP. I'll get back to you with the code if you're interested.

Re: My Metal forum, and Anime forum too! [Image heavy]

sPuD wrote:

I could give you the code to do it, but I probably won't release an official mod. You'd just have to modify an array pretty much, and make your icons (mine are being made specifically for my forum by someone else, who's not yet done as you may of noticed from that screenshot above). Also I can't guarantee that it'll be secure, as I'm not too experienced in PHP. I'll get back to you with the code if you're interested.

That would be great, I'd definitely be interested. Thank you.

5

Re: My Metal forum, and Anime forum too! [Image heavy]

sPuD: You might want to remove your IP address from the image you posted.

6

Re: My Metal forum, and Anime forum too! [Image heavy]

Paul wrote:

sPuD: You might want to remove your IP address from the image you posted.

Hey, you're right, I prolly should tongue

7

Re: My Metal forum, and Anime forum too! [Image heavy]

Hey This Points System is Looking really Kool
Looking forward to this Mod....I reallyyyyy Need it

I start thinking from where you stop thinking!!!

Re: My Metal forum, and Anime forum too! [Image heavy]

Wow PunBBeauty at work smile

9

Re: My Metal forum, and Anime forum too! [Image heavy]

Arghhhhhhhhhhhhhhh smile I WANT THE ICON MOD TOO !!!

Exactly I want (more readable for USERS !!!)

Very great !

10 (edited by Lasse 2005-08-08 19:09)

Re: My Metal forum, and Anime forum too! [Image heavy]

Your point system looks awsome.
Do you make it as a mod soon?
(can't wait..)

I would like
5 points for a post
20 points for a new tread
10 points for a sticky tread (per day)
10 points for an image in the gallery
10 points for an invitation

Is this possible?
Could you do it so that you also get points for the posts you have made before you installed the "money-mod"?

11

Re: My Metal forum, and Anime forum too! [Image heavy]

I think that it's stupid that a user can change another users titel.
So maby you could eksplain how to remove that part smile

12

Re: My Metal forum, and Anime forum too! [Image heavy]

ARRRRGGH!
Can't wait wink

13 (edited by sPuD 2005-08-08 22:25)

Re: My Metal forum, and Anime forum too! [Image heavy]

Lasse wrote:

Your point system looks awsome.
Do you make it as a mod soon?
(can't wait..)

I would like
5 points for a post
20 points for a new tread
10 points for a sticky tread (per day)
10 points for an image in the gallery
10 points for an invitation

Is this possible?
Could you do it so that you also get points for the posts you have made before you installed the "money-mod"?

I'll release my modded pages for other people to do what they wish with, however I'm not releasing an official mod, so it'll be up to you to add the other features. I'll post the modded pages in a few.

If anyone else wants to make the post icons/point system into official mods, feel free.

14

Re: My Metal forum, and Anime forum too! [Image heavy]

sPuD wrote:

I'll release my modded pages for other people to do what they wish with, however I'm not releasing an official mod, so it'll be up to you to add the other features. I'll post the modded pages in a few.

If anyone else wants to make the post icons/point system into official mods, feel free.

Cool, looking forward to being able to have post icons. Thanks smile

15

Re: My Metal forum, and Anime forum too! [Image heavy]

Here are the pages I modded for my store/point system, beware of security flaws, inefficiencies, etc.

In viewtopic.php:

find:

$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());

replace with:

$result = $db->query('SELECT u.points, u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());

(basically add u.points to the query)

find:
// Now let's deal with the contact links (E-mail and URL)

add before:

$user_info[] = '<dd>Points: '.$cur_post['points'].' (<a href="store.php?user='.$cur_post['username'].'">$</a>)';

In post.php

add

//Points for posting
$post_reward = 5;

right after the includes - at this moment its 5 points for both topics and posts, you could modify it fairly easily probably to get more points for topics.

find:

        // If the posting user is logged in, increment his/her post count
        if (!$pun_user['is_guest'])
        {
            $low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
            $db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
        }

replace with:

        // If the posting user is logged in, increment his/her post count
        if (!$pun_user['is_guest'])
        {
            $low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
            $db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.', points=points+'.$post_reward.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
        }

save the following as store.php and save to your main forum directory
http://www.geocities.com/eddof13/store.txt

and if you want your profile to reflect your points, here is my modded profile.php (copy/paste the contents of the text file):
http://www.geocities.com/eddof13/profile.txt

You'll need to add another row to punbb_users:
"points" as an int(10) with a default of 0

here's the mysql:
ALTER TABLE `punbb_users` ADD `points` INT( 10 ) DEFAULT '0' NOT NULL ;

And that's it. I may of missed something, so if I did, let me know. It should work, and if anyone wants to expand on it and make it an official mod or whatever, feel free. I'll add the post icons code possibly later this week.

16 (edited by shinko_metsuo 2005-08-09 00:30)

Re: My Metal forum, and Anime forum too! [Image heavy]

Is there a way where this can be like the Karma system on GameFAQs where it increases with visits and mods/admins can take away or add?

Also do you have a readme for what edits you did to profile.php?

17 (edited by sPuD 2005-08-09 01:56)

Re: My Metal forum, and Anime forum too! [Image heavy]

shinko_metsuo wrote:

Is there a way where this can be like the Karma system on GameFAQs where it increases with visits and mods/admins can take away or add?

Also do you have a readme for what edits you did to profile.php?

I'm sure it's possible to make it into a karma system, you'd probably have to remove the edits from post.php and make a few edits to store.php to have it how you want it.

And maybe you could edit common.php or something for the increase with visits?

I don't have a readme for profile.php, so if you want to do the edits yourself, just search "points" in that text file I gave, and it will bring you to every edit pretty much.

Re: My Metal forum, and Anime forum too! [Image heavy]

sPuD wrote:
shinko_metsuo wrote:

Is there a way where this can be like the Karma system on GameFAQs where it increases with visits and mods/admins can take away or add?

Also do you have a readme for what edits you did to profile.php?

I'm sure it's possible to make it into a karma system, you'd probably have to remove the edits from post.php and make a few edits to store.php to have it how you want it.

And maybe you could edit common.php or something for the increase with visits?

I don't have a readme for profile.php, so if you want to do the edits yourself, just search "points" in that text file I gave, and it will bring you to every edit pretty much.

With my php skills it will be hard but I'm sure I can work on it a bit and try smile

Oh and about the readme for profile.php I didn't need after all. I thought it was already modded from something else but it wasn't.

Thanks for the great mod smile

19 (edited by Lasse 2005-08-09 10:49)

Re: My Metal forum, and Anime forum too! [Image heavy]

When i run the points mod i get the following error:
I get this error when i go into my profile, and when i got into the store.
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /var/www/disneyzonen.dk/public_html/forum/store.php on line 2

Parse error: parse error, unexpected T_STRING in /var/www/disneyzonen.dk/public_html/forum/store.php on line 2

I get no points when I write a post.
And why cant i see a users point in poll-treads?
Maybe we are running a different version of PHP... (?)

Can anyone help me? tongue

20 (edited by sPuD 2005-08-10 00:32)

Re: My Metal forum, and Anime forum too! [Image heavy]

I don't know what's wrong, make sure you've made all of the edits correctly. The first lines of store.php should be something like:

<?php

// This is by me, myself, and I, all written from scratch.

define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';

I have limited PHP experience, so I can't provide support, unless there was a mistake I made in the code I gave. Also, poll threads probably have to be modded differently, which I can't help you with. Everything is provided as is.

Re: My Metal forum, and Anime forum too! [Image heavy]

You must show us the post icon mod!

22

Re: My Metal forum, and Anime forum too! [Image heavy]

How to Change the Points For New Topic ?

I start thinking from where you stop thinking!!!