You are not logged in. Please login or register.
Active topics Unanswered topics
Search options (Page 237 of 307)
Topics by Smartys User defined search
Posts found: 5,901 to 5,925 of 7,674
Works fine for me
Although I would make one change:
Remove the new code I had you add to edit.php/post.php and follow this instead:
edit.php
FIND
$hide_smilies = isset($_POST['hide_smilies']) ? intval($_POST['hide_smilies']) : 0;
if ($hide_smilies != '1') $hide_smilies = '0';
AFTER, ADD
require_once PUN_ROOT.'include/parser.php';
if (check_smilies($message) > 5 && !$hide_smilies)
$errors[] = 'You have too many smilies in your post: the maximum is 5';
post.php
FIND
$hide_smilies = isset($_POST['hide_smilies']) ? 1 : 0;
$subscribe = isset($_POST['subscribe']) ? 1 : 0;
AFTER, ADD
require_once PUN_ROOT.'include/parser.php';
if (check_smilies($message) > 5 && !$hide_smilies)
$errors[] = 'You have too many smilies in your post: the maximum is 5';
That way people who aren't using smilies aren't affected
Keep in mind this isn't meant to change existing posts, just to forbid new posts with too many smilies
OK
I think this should be the same in both files
FIND
// Validate BBCode syntax
if ($pun_config['p_message_bbcode'] == '1' && strpos($message, '[') !== false && strpos($message, ']') !== false)
{
require PUN_ROOT.'include/parser.php';
$message = preparse_bbcode($message, $errors);
}
AFTER, ADD
require_once PUN_ROOT.'include/parser.php';
if (check_smilies($message) > 5)
$errors[] = 'You have too many smilies in your post: the maximum is 5';
parser.php
Add this to the end
function check_smilies($text)
{
global $smiley_text, $smiley_img;
$text = ' '.$text.' ';
$num_smilies = count($smiley_text);
$num_message_smilies = 0;
for ($i = 0; $i < $num_smilies; ++$i)
{
$text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text, -1, $count);
$num_message_smilies = $num_message_smilies + $count;
}
return $num_message_smilies;
}
One of the admins is to blame, settings don't just change like that
I started coding it after I made that post ![tongue](https://punbb.informer.com/forums/img/smilies/tongue.png)
Look under Admin Options ![wink](https://punbb.informer.com/forums/img/smilies/wink.png)
<?php
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
// Get the array the right way!
$mod_users = array();
$result = $db->query("SELECT id, forum_name, moderators FROM ".$db->prefix."forums WHERE moderators IS NOT NULL") or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());;
while ($cur_forum = $db->fetch_assoc($result))
{
$cur_forum['moderators'] = unserialize($cur_forum['moderators']);
foreach ($cur_forum['moderators'] as $mod_name => $mod_id)
{
$mod_users[$mod_name][$cur_forum['id']] = $cur_forum['forum_name'];
}
}
require PUN_ROOT.'header.php';
?>
<div class="blockform">
<h2><span>Moderator List</span></h2>
<div class="box">
<form method="post" action="thisisfake.php">
<?php
foreach ($mod_users as $mod_name => $forums)
{
?>
<div class="inform">
<fieldset>
<legend><?php echo $mod_name ?></legend>
<div class="infldset">
<?php
foreach ($forums as $forum_id => $forum_name)
{
?>
<label><a href="viewforum.php?id=<?php echo $forum_id ?>"><?php echo $forum_name ?></a></label>
<?php
}
?>
</div>
</fieldset>
</div>
<?php
}
?>
</form>
</div>
</div>
<?php
require PUN_ROOT.'footer.php';
Ugly? Yes. Using a form that doesn't go anywhere? Yes. Working properly? Yes. ![tongue](https://punbb.informer.com/forums/img/smilies/tongue.png)
Bah, I'll write some better code ![tongue](https://punbb.informer.com/forums/img/smilies/tongue.png)
You somehow deleted the guest user: you'll need to manually create a new one ![wink](https://punbb.informer.com/forums/img/smilies/wink.png)
It sounds like the xfire column wasn't dropped then
PHPAuctionsites.com wrote:I would agree Smartys but i dont know how i would do it, im no coder copy paste is my max realy lol
Well that's what you would do with what I said ![tongue](https://punbb.informer.com/forums/img/smilies/tongue.png)
Open viewforum.php
FIND
if (!$db->num_rows($result))
message($lang_common['Bad request']);
REPLACE WITH
if (!$db->num_rows($result))
message('Please login.');
Of course, replace my text with your own ![wink](https://punbb.informer.com/forums/img/smilies/wink.png)
And keep in mind that they will see that message when they enter any invalid forum IDs, nos just forums they don't have permission to read
Oh, whoops, I know why ![big_smile](https://punbb.informer.com/forums/img/smilies/big_smile.png)
Yeah, it's not a simple thing to do that ![tongue](https://punbb.informer.com/forums/img/smilies/tongue.png)
I guess the easiest way would be to write a new function (or mod do_smilies) to tell you how many smilies are in a post and use that knowledge in post.php and edit.php to reject posts that are over
Enable debug mode, post the full error
When Rickard places it online (which depends on how far along he is) ![tongue](https://punbb.informer.com/forums/img/smilies/tongue.png)
pogenwurst wrote:elbekko wrote:Check the language files ![wink](https://punbb.informer.com/forums/img/smilies/wink.png)
Though that would mess with genuine errors, too.
Yeah, you'd probably want to write your own entry in the langauge file and then use that instead for this one location (or just hardcode the string in viewforum.php)
I'd try
FIND
$num_smilies = count($smiley_text);
AFTER, ADD
if ($num_smilies > 5)
$num_smilies = 5;
err, yes there is...
//
// Convert a series of smilies to images
//
function do_smilies($text)
{
global $smiley_text, $smiley_img;
$text = ' '.$text.' ';
$num_smilies = count($smiley_text);
for ($i = 0; $i < $num_smilies; ++$i)
$text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);
return substr($text, 1, -1);
}
Your host has disabled file uploads via PHP
Yeah, set me as admin so I can check a couple things (my nick is test)
Can I have a URL to the forum?
Because you're uploading from your computer
I'm afraid that's a problem with NetFirms and the old version of MySQL they use, not with PunBB ![wink](https://punbb.informer.com/forums/img/smilies/wink.png)
Enable debug mode and post the full error
Paul is just psychic like that ![smile](https://punbb.informer.com/forums/img/smilies/smile.png)
Personally, I don't think "Which forum software is better" questions are best asked on the support forum of one of the choices: as has been said there, you'll get a biased answer ![tongue](https://punbb.informer.com/forums/img/smilies/tongue.png)
On the other hand, asking "Is PunBB the right choice for me in these circumstances and if not, do you have any suggestions for alternatives" is better. Forum softwares are built for different things. PunBB is built to be lightweight. If you need more advanced group management and don't want to pay, I'd suggest phpBB (although that's probably because I'm not as familiar with SMF, etc).
So while I don't think it would be OK to make a topic about which forum software has the superior [feature x], I think it's OK to ask if this forum software has the necessary features and, if it doesn't, to ask for suggestions of alternatives
Posts found: 5,901 to 5,925 of 7,674