Wish I could help. That's the point where it becomes greek to me
26 2007-06-18 18:10
Re: New frontpage index mod! (188 replies, posted in PunBB 1.2 modifications, plugins and integrations)
27 2007-06-18 17:55
Re: New frontpage index mod! (188 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Are those spans in the $append? If so leave them open.
28 2007-06-18 05:37
Re: New frontpage index mod! (188 replies, posted in PunBB 1.2 modifications, plugins and integrations)
MattF wrote:The only problem with truncation is that it screws the W3C compliance if it happens to trim the message inbetween a pair of tags.
Actually, this is true but soonotes (tinytim) managed to resolve this issue with his User Blogs.
Yeah, had to do some searching to get that to work as the function for it is beyond my abilities. I would love to give proper credit for the functions below but I lost that info and have not been able to find it again.
Here's the code from blog.php where I call the function
//First we parse the message
$pre = parse_message($cur_blog['blog'], $cur_blog['hide_smilies']);
// Now we trim it
$str = truncate ($pre, $id);
$pre parses the message normal pun style (ie $cur_post) and then the truncate function is called.
The message and the blog id are required due to the fact the function also adds a 'read more' link.
Below are two functions actually. The truncate function does just that. The close tags function closes any open tags and is fully xhtml 1.0 compliant (ie. it accounts for self closing tags like img)
You should be able to use this without much trouble for what you want to do.
If you look at the truncate function you'll notice $len which sets the amount of characters to display. You will probably want to hard code that. (ie. $len = 400;)
The other variable you need to adjust is $append which adds the read more link.
Hope that helps.
//
// Close any open tags when truncating a blog
//
function close_tags($string)
{
// match opened tags
if(preg_match_all('/<([a-z\:\-]+)[ >]/', $string, $start_tags))
{
$start_tags = $start_tags[1];
// match closed tags
if(preg_match_all('/<\/>([a-z]+)>/', $string, $end_tags))
{
$complete_tags = array();
$end_tags = $end_tags[1];
foreach($start_tags as $key => $val)
{
$posb = array_search($val, $end_tags);
if(is_integer($posb))
{
unset($end_tags[$posb]);
}
else
{
$complete_tags[] = $val;
}
}
}
else
{
$complete_tags = $start_tags;
}
$complete_tags = array_reverse($complete_tags);
for($i = 0; $i < count($complete_tags); $i++)
{
$string .= '</' . $complete_tags[$i] . '>';
}
}
// Removes the </img> tag
$xhtml_tags = array("</img>", "</hr>", "</br>");
$string = str_replace($xhtml_tags, "", $string);
return $string;
}
//
// Truncate string longer than max length
//
function truncate($str, $id) {
global $pun_config;
$len = $pun_config['b_blog_trun_length'];
$splitter = '<!--MORE-->';
$append = ' ... <span class="barlink"><i><a href="blog.php?cid='.$id.'&c_id='.$id.'">Full Blog';
if(strlen($str) <= $len){
return $str;
}
if($len > 0 && !strstr($str,$splitter)){
preg_match('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){'.$len.',}\b#U', $str,$matches);
$str = $matches[0];
# remove trailing opener tags and close all other open tags:
$str = close_tags(preg_replace('#\s*<[^>]+>?\s*$#','',$str).$append);
} else {
$arr = explode($splitter,$str,2);
$str = $arr[0];
}
return $str;
}
29 2007-06-07 04:39
Re: 'all discussions' or 'forums' listing (16 replies, posted in Feature requests)
Oh $*@&, forgot about this
I'll get on this in a couple of days. Been pretty busy. Shouldn't be a mod that requires much modding anyway.
30 2007-06-03 04:58
Re: Problem with poll (9 replies, posted in PunBB 1.2 modifications, plugins and integrations)
It works fine for everyone else. Try going through the install steps again and make sure you didn't miss something.
Have there been any error messages? Have you enabled debug mode and looked if any queries take place when you click on submit? We need more information to help.
31 2007-05-30 05:17
Re: What do you think??? (13 replies, posted in PunBB 1.2 show off)
Shows up fine now.
32 2007-05-28 20:34
Re: What do you think??? (13 replies, posted in PunBB 1.2 show off)
It doesn't work. I'm assuming there should be content in the middle but I just see black space. None of the links do anything either. Using latest version of Opera with Vista.
http://img509.imageshack.us/my.php?imag … d01ar9.jpg
33 2007-05-27 20:49
Re: 'all discussions' or 'forums' listing (16 replies, posted in Feature requests)
I think that's a great idea!
I'll make up a mod for that when I get a chance. A quick change to search.php lets you show all posts pretty easily. Example of all posts
34 2007-05-25 22:43
Re: Reputation Mod- Default Rating (15 replies, posted in PunBB 1.2 troubleshooting)
The mod you linked to does not give the user an option to enable/disable in the users profile. Which mod are you using?
35 2007-05-25 13:46
Re: Reputation Mod- Default Rating (15 replies, posted in PunBB 1.2 troubleshooting)
Just change the default from 0 to 10
ADD COLUMN reputation_plus INT(11) UNSIGNED DEFAULT 10,
36 2007-05-25 04:14
Re: Will not work unless I turn off my Zone Alarm Security (21 replies, posted in PunBB 1.2 troubleshooting)
Registered and posted a test message. No issues at all. Not sure why you wanted someone to do that though. The answer is here.
37 2007-05-25 02:12
Re: Vulnerable to spambots (89 replies, posted in PunBB 1.2 discussion)
I use a slightly different solution for spammers. I have a submission form on my site (no visible links) the bots latch onto. I get a couple of submissions daily with the cialis, viagra crap etc. and the occasional virus (small attachments are permitted) which come in email and are filtered into a junk mail folder which I check and empty now and then.
So the bots use that form and leave the forums alone. Works like a charm. As for the topic here I'm with the minimalists. It's not hard to install a mod if needed.
38 2007-05-21 06:45
Re: i need my Stats file any one help me find it! (6 replies, posted in PunBB 1.2 troubleshooting)
Those stats only show on the index page and that is where they are generated.
Around line 150 of index.php you see
// Collect some statistics from the database
From there down to about line 203 the stats are collected and displayed.
39 2007-05-15 02:07
Re: Online Status (6 replies, posted in PunBB 1.2 modifications, plugins and integrations)
http://www.punres.org/files.php?pid=354
Not quite what you asked but gives all users to 'hide' from the online list.
Keep in mind if using the 'online today' mod it would still show all users even if they chose to be hidden.
40 2007-05-11 16:04
Re: SunBB 0.1 released (23 replies, posted in General discussion)
You changed the name, basically replaced Pun with Sun everywhere it shows. You changed the footer a bit. Ok, I don't get it. You released an incomplete version of Pun 1.3 under a different name. What's the point?
What bugs have you 'fixed' to make it 'stable'?
41 2007-05-08 23:19
Re: Is there a way to remove side blocks (3 replies, posted in General discussion)
Create a new template file based on the original main.tpl
Open header.php
find
else if (defined('PUN_HELP'))
$tpl_main = file_get_contents(PUN_ROOT.'include/template/help.tpl');
change to
else if (defined('PUN_HELP'))
$tpl_main = file_get_contents(PUN_ROOT.'include/template/help.tpl');
else if (defined('PUN_ALT'))
$tpl_main = file_get_contents(PUN_ROOT.'include/template/new_template.tpl');
In the files you want a different template for add
define('PUN_ALT',1);
before the header is called.
42 2007-05-07 18:02
Re: quick question: where is the base url? (4 replies, posted in PunBB 1.2 discussion)
Where is it? In the config table in the db, stored in cache/cache_config.php and set in admin_options. Hope that helps, not sure what you're asking.
43 2007-05-06 18:52
Re: Just wondering if someone can help me with my site (28 replies, posted in General discussion)
If all goes well tonight I will release it tomorrow morning on my site.
Are you planning on releasing this to PunRes also?
45 2007-04-25 05:18
Re: puntoolbar (13 replies, posted in PunBB 1.2 troubleshooting)
Yeah, but it generates the cache file.
46 2007-04-25 05:05
Re: puntoolbar (13 replies, posted in PunBB 1.2 troubleshooting)
The part of parser.php you posted looks exactly like it should then. Double check the parts of it that were modified.
As for the file cache_puntoolbar.php it looks like it was named incorrectly and should be puntoolbar.php
47 2007-04-25 04:55
Re: puntoolbar (13 replies, posted in PunBB 1.2 troubleshooting)
I changed something but it didn't show up. Like I said in my edit the if statement should be on a different line, don't know why the forum won't put it there. Is it on a different line in your parser.php
48 2007-04-25 04:48
Re: puntoolbar (13 replies, posted in PunBB 1.2 troubleshooting)
// We found a [quote]or a [quote=username]if ($q3_start min($q_end, $c_start, $c_end))
should be
// We found a [quote]or a [quote=username]if ($q3_start < min($q_end, $c_start, $c_end))
edit, for some reason the site wants to put the if ($q3_start... on the same line as the commented part. I'm guessing it's not on the same line in your code.
As for the missing file not sure since I cannot find this mod anywhere.
49 2007-04-25 04:06
Re: HELP!!! (8 replies, posted in PunBB 1.2 troubleshooting)
Now change it to the correct base url
You will need to delete the file cache_config.php in the forums cache directory also. I think CPanel should have a file manager for you to do that.
50 2007-04-24 00:41
Re: Punbb with mods (8 replies, posted in PunBB 1.2 discussion)
There's a few packages of mods you can check into.
http://www.punres.org/desc.php?pid=253
http://www.punres.org/viewtopic.php?id=915
And a couple more I think too.
But since they are mostly done by active users here, and people of "trust" apprently, then why aren't they supported?
I don't know about that. Anyone can submit a mod.
If you're only looking for a few mods just install PunBB and then install the mods. It's not hard to do and it is a good way to get familiar with the way PunBB is coded.