Sometimes older is better...
1 2006-09-25 02:17
Re: Trying to make a user punbb gallery... (9 replies, posted in PunBB 1.2 troubleshooting)
2 2006-09-25 02:09
Re: Trying to make a user punbb gallery... (9 replies, posted in PunBB 1.2 troubleshooting)
2nd one...
3 2006-09-25 02:06
Re: Trying to make a user punbb gallery... (9 replies, posted in PunBB 1.2 troubleshooting)
1.1.5
it's $cur_user instead of $pun_user
4 2006-09-25 02:03
Re: Trying to make a user punbb gallery... (9 replies, posted in PunBB 1.2 troubleshooting)
sorry...here's the complete code...and I do believe it is...
<?php
$pun_root = '../../';
require $pun_root.'include/common.php';
$_GET['id'] = $id;
if (empty($id) || $id < 2) {
message('Bad request.');
}
if ($cookie['is_guest'] || $cur_user['id'] != $id && $cur_user['status'] < PUN_MOD) {
message('You are not allowed to access this page.');
}
if (isset($_POST['form_sent']))
{
$uploaded_file = $_FILES['image'];
// Make sure the upload went smooth
switch ($_FILE['image']['error'])
{
case 1: // UPLOAD_ERR_INI_SIZE
case 2: // UPLOAD_ERR_FORM_SIZE
message('Too large.');
break;
case 3: // UPLOAD_ERR_PARTIAL
message('Partial upload.');
break;
case 4: // UPLOAD_ERR_NO_FILE
message('No file.');
break;
default:
// No error occured, but was something actually uploaded?
if ($_FILE['image']['size'] == 0)
message('No file');
break;
}
if (is_uploaded_file($uploaded_file['tmp_name']))
{
$ok_filetypes = array('image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png');
if (!$_FILES['image']['error'] && $_FILES['image']['size'] > $pun_config['o_avatars_size'] * 1024) {
message('Sorry, but the attached file is too large. Please reduce the size of it\'s contents.'); // #err
}
$filename = (!$_FILES['image']['error'] ? substr(basename($_FILES['image']['name']), -30 ) : '');
$x = strtolower(substr($_FILES['image']['name'], -3));
if ($filename && !in_array($x, $ok_filetypes)) {
message('Sorry, the filetype you have tried to upload is not allowed.');
}
$uniq = $id.'_'.substr(md5(uniqid(rand())), 0, 10);
// This is line is commented for a reason
// $ext = strtolower( substr($_FILES['attached']['name'], -3));
move_uploaded_file($_FILES['image']['tmp_name'], $pun_config['o_base_url'].'/members/images/'.$uniq);
// Put the stuff in the db
$db->query('INSERT INTO '.$db->prefix.'gallery (user_id, url, caption) VALUES(
\''.addslashes($id).'\',
\''.addslashes($uniq).'\',
\''.addslashes($_POST['caption']).'\'
)') or error('Unable to insert picture into db', __FILE__, __LINE__, $db->_error());
redirect('profile.php?id='.$id, 'Your Picture has been added! Redirecting...');
}
} else {
require $pun_root.'header.php';
?>
<form action="<?php echo $pun_root ?>members/images/upload.php?id=<?php echo $id ?>" method="POST" enctype="multipart/form-data">
<input type="hidden" name="form_sent" value="1" />
<input type='hidden' name='MAX_FILE_SIZE' value='614400' />
<table cellpadding="4" cellspacing="1" class="main" width="420">
<tr class="head">
<td class="head"><b>Upload Image</b></td>
</tr>
<tr class="con1">
<td style="padding-bottom:0px;">Upload an Image<br /><span class="small"><i>Images must be in JPEG, BMP, or GIF format and less than 512kb in size.</i></span></td>
</tr>
<tr class="con1">
<td><input type="file" name="image" size="50" /></td>
<tr class="con1">
<td>
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<td>
Add a Caption:
</td>
</tr>
<tr>
<td>
<input type="text" name="caption" style="width:400px;" maxlength="216" />
</td>
</tr>
</table>
</td>
</tr>
<tr class="con1">
<td align='right'><input type="submit" name="submit" class="button" value="Submit" /></td>
</tr>
</table>
</form>
<?php
require $pun_root.'footer.php';
}
?>
5 2006-09-25 01:59
Topic: Trying to make a user punbb gallery... (9 replies, posted in PunBB 1.2 troubleshooting)
$_GET['id'] = $id;
if (empty($id) || $id < 2) {
message('Bad request.');
}
if ($cookie['is_guest'] || $cur_user['id'] != $id && $cur_user['status'] < PUN_MOD) {
message('You are not allowed to access this page.');
}
if (isset($_POST['form_sent']))
{
$uploaded_file = $_FILES['image'];
// Make sure the upload went smooth
switch ($_FILE['image']['error'])
{
case 1: // UPLOAD_ERR_INI_SIZE
case 2: // UPLOAD_ERR_FORM_SIZE
message('Too large.');
break;
case 3: // UPLOAD_ERR_PARTIAL
message('Partial upload.');
break;
case 4: // UPLOAD_ERR_NO_FILE
message('No file.');
break;
default:
// No error occured, but was something actually uploaded?
if ($_FILE['image']['size'] == 0)
message('No file');
break;
}
if (is_uploaded_file($uploaded_file['tmp_name']))
{
$ok_filetypes = array('image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png');
if (!$_FILES['image']['error'] && $_FILES['image']['size'] > $pun_config['o_avatars_size'] * 1024) {
message('Sorry, but the attached file is too large. Please reduce the size of it\'s contents.'); // #err
}
$filename = (!$_FILES['image']['error'] ? substr(basename($_FILES['image']['name']), -30 ) : '');
$x = strtolower(substr($_FILES['image']['name'], -3));
if ($filename && !in_array($x, $ok_filetypes)) {
message('Sorry, the filetype you have tried to upload is not allowed.');
}
$uniq = $id.'_'.substr(md5(uniqid(rand())), 0, 10);
// This is line is commented for a reason
// $ext = strtolower( substr($_FILES['attached']['name'], -3));
move_uploaded_file($_FILES['image']['tmp_name'], $pun_config['o_base_url'].'/members/images/'.$uniq);
// Put the stuff in the db
$db->query('INSERT INTO '.$db->prefix.'gallery (user_id, url, caption) VALUES(
\''.addslashes($id).'\',
\''.addslashes($uniq).'\',
\''.addslashes($_POST['caption']).'\'
)') or error('Unable to insert picture into db', __FILE__, __LINE__, $db->_error());
redirect('profile.php?id='.$id, 'Your Picture has been added! Redirecting...');
}
I get the message: "No File" whenever I try to upload an image but the problem is is that there is a file...Does anyone see an error in my syntax?
6 2006-04-23 05:09
Re: Urban Idiots Forum (5 replies, posted in PunBB 1.2 show off)
Interesting program. I like it! I think I will implement it next time I update Urban Idiots. I'll be sure to tell you how it works out and are you affiliated with that website/script? If so tell them that's what I've been looking for.
Nice layout but none of your images show up.
I wonder why that could be. For me, it shows up fine in Firefox, IE, and Netscape. Any suggestions for fixing this?
7 2006-04-22 04:07
Topic: Urban Idiots Forum (5 replies, posted in PunBB 1.2 show off)
Hey guys, this is just something I've been working on in my spare time.
http://urbanidiots.awardspace.com/forums.php
It currently runs punbb version 1.2.11. It looks like the design from the 1.1 series. That is because I really liked the style of the older version. Yes, it is heavily modded which is exactly why I like punbb, because it is easy to modify!
Constructive criticism is appreciated. Thanks...
8 2005-10-08 00:25
Re: anyone willing to help me intergrate to my site (3 replies, posted in PunBB 1.2 troubleshooting)
KOVA, if you are willing to give out that kind of trust to some random person, I'd be glad to help you. I've integrated many websites and forums together. I do website programming and design in my spare time. Since this is only for free, I'd only do the basics. Nothing special...but I'm willing to offer my services...
9 2005-09-22 20:18
Re: Integrated Punbb into your site? Post your link (60 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Here is my website: http://vganda.com
I used the very basics of punbb version 1.1.5 and modded it and made a homemade CMS...I started this project off and on since about May of 2005...so I've been working on it for quite awhile now...
10 2005-07-16 09:09
Re: Vganda (5 replies, posted in PunBB 1.2 show off)
You're about the 999th person who asks me this. I only used the basic features of punbb, no templates or language files or anything like that. I grabbed the code I needed. You have to be into PHP and MYSQL if you want to make that work. There's a lot to be modified, and its impossible to give you a step by step how-to.
You can use the extern.php file of punbb to get the active topics list, but if you just know the very basics of PHP and MYSQL, you should be able to easily do it yourself.
Don't be discouraged though; when I started out with all this php stuff I was messing around with a very simple script not knowing anything about php and mysql (I did know about HTML), and learned along the way. I suggest you try the same thing. Get a simple messageboard( punbb of course ) - or similar script, and start messing with it. However, if you don't know the basics of HTML I suggest you start with that first.
You can check www.hotscripts.com for scripts, but there are more sites out there of course.
Im not sure what you already know, but if you are a total beginner I'd suggest this:
1. Do a HTML tutorial. And do it all in NOTEPAD, not dreamweaver. You'll become a 1337 HTML'er who knows what he's doing. It'll save you a LOT of time to fix errors and stuff. There have been quite some dreamweaver-fella's who needed help with the most simple errors on their websites. Start using dreamweaver when you can write all the basic html in notepad.
2. Find a nice PHP+MYSQL script with something like a message submit into a database. Whatever you don't understand you will find in any basic PHP/MYSQL tutorial. Mess with it, change stuff, see what happens. If you're at this point and get stuck, you can ask me for help if you want.
3. Try to recreate stuff.
Trial and error will make you good, no matter how much tutorials you read. But you already know that of course.
Good luck,
Goober
12 2005-07-07 21:36
Topic: Vganda (5 replies, posted in PunBB 1.2 show off)
Hey, this is what I've been working on for the past few months or so on. I didn't want to use verison 1.2 because I thought it was to complicated for my needs. I didn't want user groups or anything like that so I stuck with good old verison 1.1.5... Tell me what you think. Oh I had to remove the copyright because I don't use the footer.php file anymore. I relocated the copyright to the links page. So any criticism whether good or bad is wanted. I still am working out the bugs so please bear with me...
Here's the link:
http://vganda.com/forums.php
~Goober
13 2005-05-28 18:09
Re: Additional Multipurpose pages... (7 replies, posted in PunBB 1.2 troubleshooting)
Sweet I do have access to punbb's global variables...
14 2005-05-28 17:59
Re: Additional Multipurpose pages... (7 replies, posted in PunBB 1.2 troubleshooting)
I replaced require with require_once and I stopped getting the error message, although I'm going to run some tests to see if works properly...
15 2005-05-28 17:30
Re: Additional Multipurpose pages... (7 replies, posted in PunBB 1.2 troubleshooting)
Hmmm...I commented everything in my script with extern.php and it still displays the same error message.
16 2005-05-28 17:15
Re: Additional Multipurpose pages... (7 replies, posted in PunBB 1.2 troubleshooting)
yes, I am including extern.php but not functions.php...
17 2005-05-28 05:17
Topic: Additional Multipurpose pages... (7 replies, posted in PunBB 1.2 troubleshooting)
I know that punbb is made up of multipurpose pages and what I plan on doing is add an additional multipurpose page. Whenever I try to include the common.php file I get this fatal error:
Fatal error: Cannot redeclare check_cookie() (previously declared in /var/www/html/include/functions.php:29) in /var/www/html/include/functions.php on line 29
Is there anyway I that I can fix this while still having access to punbb's global variables?
Thanks,
~Goober
18 2005-05-26 02:55
Re: Disable Post Counting (per-forum basis) (6 replies, posted in Feature requests)
Sorry, I meant to say post count... Silly me...
19 2005-05-25 19:51
Re: Disable Post Counting (per-forum basis) (6 replies, posted in Feature requests)
Connorhd, I think she is asking for a mod or a feature that allows post count to be disabled in certain parts of the forum...
20 2005-05-22 20:06
Re: Unable to fetch forum info (2 replies, posted in PunBB 1.2 troubleshooting)
Lol, nevermind, I figured out the problem...
The variables on line 70 in post.php are listed from the query on line 58. They were already listed on line 62. The listing is incomplete since there are more values fetched in the query then there are listed so both vars were empty. The function on line 75 sends the empty var $forum_id to the function, but since its empty it can't complete the query on line 252 in functions.php.
It was just a matter of effort on my part. But thanks for taking interest in my post...
~Goober
21 2005-05-18 03:25
Topic: Unable to fetch forum info (2 replies, posted in PunBB 1.2 troubleshooting)
I seem to get an error message when I try to make replys to topics but not when I post a new topic. Here is the error message:
An error was encountered
File: /var/www/html/include/functions.php
Line: 252
PunBB reported: Unable to fetch forum info
Database reported: You have an error in your SQL syntax near '' at line 1 (Errno: 1064)
Here is line 252:
$result = $db->query('SELECT moderators, admmod_only, closed FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
I also ran dump() and here is what I got when I tried to post using the quick post:
SELECT moderators, admmod_only, closed FROM pun_forums WHERE id=
Here is what i got using post.php:
SELECT moderators, admmod_only, closed FROM pun_forums WHERE id=6
PS: I've using version 1.1.5
Any ideas what is wrong? Thanks,
~Goober
22 2005-05-03 01:56
Re: Ranks w/ stars ? (36 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Ok, the programming part is solved...now we just need some good rank images...
If anyone has any good likes, please share them...
This image is from Proboards -> http://4d5.net/boardimages/star.gif
23 2005-05-02 10:39
Re: New posts - not showing new but top of page (24 replies, posted in PunBB 1.2 troubleshooting)
What's the error message you get?
24 2005-04-19 03:32
Re: World Village (4 replies, posted in PunBB 1.2 show off)
I know, but he has the maintenance message up right because he is doing something to it... but when you guys get a chance, check it out!
25 2005-04-07 20:37
Re: Layout Questions: Your own header without using iframe (11 replies, posted in PunBB 1.2 troubleshooting)
They're in the php files, (edit header.php if you want to edit the header) but like Connorhd said, you could just use main.tpl but it also depends on what your trying to do...