2011-02-07, 07:49 PM
Pages: 1 2
2011-02-07, 08:39 PM
css:
blockquote img a,blockquote img{display:none}
2011-02-07, 09:16 PM
I'd rather strip it from the input when the post is quoted -- so that an img can be manually inserted into a quote if necessary -- but this is helpful if it can't happen, thanks.
2011-02-08, 04:05 AM
<?php
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
/**
* Plugin info
*
*/
function dont_quote_images_info()
{
return array(
"name" => "Dont Quote Images",
"description" => "",
"website" => "",
"author" => "Santiago Dimattia",
"authorsite" => "http://www.teleportz.com.ar",
"version" => "0.1",
"guid" => "",
"compatibility" => "16*"
);
}
/**
* Hook functions
*
*/
$plugins->add_hook('newreply_end', 'dont_quote_images_do');
/**
* Delete :)
*
*/
function dont_quote_images_do()
{
global $mybb, $message;
if(isset($mybb->input['pid']))
{
$message = preg_replace("#\[img\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#ise", "", $message);
}
}
As far as I can tell, it works OK.
2011-02-08, 08:35 PM
where do you place this?
2011-02-08, 09:31 PM
(2011-02-08, 08:35 PM)Uncontrol Wrote: [ -> ]where do you place this?
It's a plugin. Save the code as dont_quote_images.php and upload it to the plugins folder.
2011-02-08, 10:15 PM
no ending parameters. correct code
<?php
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
/**
* Plugin info
*
*/
function dont_quote_images_info()
{
return array(
"name" => "Dont Quote Images",
"description" => "",
"website" => "",
"author" => "Santiago Dimattia",
"authorsite" => "http://www.teleportz.com.ar",
"version" => "0.1",
"guid" => "",
"compatibility" => "16*"
);
}
/**
* Hook functions
*
*/
$plugins->add_hook('newreply_end', 'dont_quote_images_do');
/**
* Delete :)
*
*/
function dont_quote_images_do()
{
global $mybb, $message;
if(isset($mybb->input['pid']))
{
$message = preg_replace("#\[img\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#ise", "", $message);
}
}
?>
2011-02-08, 10:33 PM
(2011-02-08, 10:15 PM)TheGodFather Wrote: [ -> ]no ending parameters. correct code
<?php if(!defined("IN_MYBB")) { die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined."); } /** * Plugin info * */ function dont_quote_images_info() { return array( "name" => "Dont Quote Images", "description" => "", "website" => "", "author" => "Santiago Dimattia", "authorsite" => "http://www.teleportz.com.ar", "version" => "0.1", "guid" => "", "compatibility" => "16*" ); } /** * Hook functions * */ $plugins->add_hook('newreply_end', 'dont_quote_images_do'); /** * Delete :) * */ function dont_quote_images_do() { global $mybb, $message; if(isset($mybb->input['pid'])) { $message = preg_replace("#\[img\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#ise", "", $message); } } ?>
It's not required to close the PHP tags.
In fact, it's recommended not to close them, as it prevents whitespaces at the end of the file (causing headers not being sent to the browser).
---
If you do close the tag, double-check if there is a whitespace or a linebreak at the end of the file before saving.
2011-02-10, 12:10 AM
I suggest not delete img tags, but replace with image links.
How to do that?
How to do that?
2011-02-10, 12:12 AM
This should work:
$message = preg_replace("#\[img\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#ise", "\(Image: $2)\n", $message);
Pages: 1 2