Jump to content


- - - - -

(iNV23) Signature Limitation v1.1.0


  • Please log in to reply
159 replies to this topic

#1 Pete T

Pete T

    IP.Board Owner

  • Modders
  • PipPipPipPipPipPipPipPip
  • 1,031 posts
  • Location:Bristol, UK
  • Real Name:Pete Treanor
  • IPB Version:v3.3.x
Contributor

Posted 30 May 2008 - 09:32 PM

Posted Image


File Name: (iNV23) Signature Limitation v1.1.0
File Submitter: Pete T
File Submitted: 30 May 2008
File Updated: 30 Apr 2009
File Category: IP.Board v2.3.x Mods

Description
Controlling the signature with some limitation via the Admin Cp.

- Features:
. Allow/Disallow links in signatures
. Limit the number of lines
. Limit number of characters per line
. Limit the number of images
. Limit the size of each image
. Limit the total size of images (kb)
. Show once per topic page?
. Not show signatures in messages
. Only show signatures in specified forums
. Not show signatures for specified groups
. Not apply the limits to specified groups

Compatibility
This mod is compatible with the IP.Board 2.3.x series.

Requirements
This mod was designed to be installed using the Universal Mod Installer, available from Invision Modding.

Files Affected

/sources/action_public/messenger.php
/sources/action_public/topics.php
/sources/lib/func_usercp.php 1.1.0 FIXES 2 bugs.

Be sure to back up these files before continuing!

Files/Folders To Upload

/mod_install/signature.xml

Click here to download this file

Posted Image

Coming Soon


Motorhome Today


#2 sinister

sinister

    Member

  • Members
  • PipPipPip
  • 27 posts
  • Location:Suva,Fiji
  • IPB Version:v2.3.x

Posted 31 May 2008 - 01:24 AM

Thanks, great job and cool that you use the BoT File editor making my life easier, thanks!

#3 emoney

emoney

    I'll do graffiti if you sing to me in french

  • Modders
  • PipPipPipPipPipPipPipPip
  • 1,269 posts
  • Real Name:Eric
  • IPB Version:v3.1.x
Contributor

Posted 31 May 2008 - 03:57 PM

Thanks for upgrading this!  I'm wondering though... is there something wrong with the 1.0.4 version of this mod on 2.3?  I'm using that and there are a few added features I would like but it seems to work well enough.

And while I'm here...What about an overall dimensions limit?  I know you can do image size max and max lines and character per line, but people can still max out both the images and text lines at the same time to effectively have a sig twice as long as I would like.  That make sense?

#4 ziomek

ziomek

    Member

  • Members
  • PipPipPip
  • 47 posts
  • IPB Version:v2.3.x

Posted 31 May 2008 - 07:32 PM

Thanks for mod, but i have error
Fatal error: Call to undefined function: check_sig() in /home/fuji321/public_html/sources/lib/func_usercp.php on line 1815
whats wrong ?

#5 Pete T

Pete T

    IP.Board Owner

  • Modders
  • PipPipPipPipPipPipPipPip
  • 1,031 posts
  • Location:Bristol, UK
  • Real Name:Pete Treanor
  • IPB Version:v3.3.x
Contributor

Posted 31 May 2008 - 08:15 PM

View Postziomek, on May 31 2008, 08:32 PM, said:

Thanks for mod, but i have error
Fatal error: Call to undefined function: check_sig() in /home/fuji321/public_html/sources/lib/func_usercp.php on line 1815
whats wrong ?

can your please copy that linee 1815 then i can tell you, but could be the bot edit not done both parts the edits need for that file.

Posted Image

Coming Soon


Motorhome Today


#6 Pete T

Pete T

    IP.Board Owner

  • Modders
  • PipPipPipPipPipPipPipPip
  • 1,031 posts
  • Location:Bristol, UK
  • Real Name:Pete Treanor
  • IPB Version:v3.3.x
Contributor

Posted 31 May 2008 - 08:18 PM

View Postemoney, on May 31 2008, 04:57 PM, said:

Thanks for upgrading this!  I'm wondering though... is there something wrong with the 1.0.4 version of this mod on 2.3?  I'm using that and there are a few added features I would like but it seems to work well enough.

And while I'm here...What about an overall dimensions limit?  I know you can do image size max and max lines and character per line, but people can still max out both the images and text lines at the same time to effectively have a sig twice as long as I would like.  That make sense?

Not to sure what mean get idea that saying to me if set your image 150 x 150 then set your lines 4, people still maxing that out ! is that what sort trying tell me.

Posted Image

Coming Soon


Motorhome Today


#7 ziomek

ziomek

    Member

  • Members
  • PipPipPip
  • 47 posts
  • IPB Version:v2.3.x

Posted 31 May 2008 - 08:21 PM

if ($do_check) $this->check_sig($this->ipsclass->input['Post']);

Quote

//-----------------------------------------
// Post process the editor
// Now we have safe HTML and bbcode
//-----------------------------------------

$this->ipsclass->input['Post'] = $this->class->han_editor->process_raw_post( 'Post' );

# Check signature
if ($this->ipsclass->vars['sl_enable'] && ! empty($this->ipsclass->input['Post']))
{
$do_check = ($this->ipsclass->vars['sl_scope'] && preg_match("/(^|,)".$this->ipsclass->member['mgroup']."(,|$)/", $this->ipsclass->vars['sl_scope'])) ? 0 : 1;
if ($do_check) $this->check_sig($this->ipsclass->input['Post']);
}


#8 emoney

emoney

    I'll do graffiti if you sing to me in french

  • Modders
  • PipPipPipPipPipPipPipPip
  • 1,269 posts
  • Real Name:Eric
  • IPB Version:v3.1.x
Contributor

Posted 31 May 2008 - 08:40 PM

View PostPeteT, on May 31 2008, 03:18 PM, said:

View Postemoney, on May 31 2008, 04:57 PM, said:

Thanks for upgrading this!  I'm wondering though... is there something wrong with the 1.0.4 version of this mod on 2.3?  I'm using that and there are a few added features I would like but it seems to work well enough.

And while I'm here...What about an overall dimensions limit?  I know you can do image size max and max lines and character per line, but people can still max out both the images and text lines at the same time to effectively have a sig twice as long as I would like.  That make sense?

Not to sure what mean get idea that saying to me if set your image 150 x 150 then set your lines 4, people still maxing that out ! is that what sort trying tell me.
Let me try to give an example:

I don't want sigs to be over 250 pixels in height or 700 pixels in width.

I set the images to 2 max images, and 125X700 for each, so if they use 2 images it equals 250X700
I set the max number of lines to 20 lines, since that is about 250 pixels high give or take.  
But a user can type 20 lines of text and then place 2 images at 125 height each, so then their overall sig when counting the text lines and the 2 images turns out to be 500 pixels high, obviously way over the limit I want in place.

So I would like a featured added that is for OVERALL height and width limitation.  So users can't max out the text and images to make 1 huge sig.

that make more sense?

#9 Pete T

Pete T

    IP.Board Owner

  • Modders
  • PipPipPipPipPipPipPipPip
  • 1,031 posts
  • Location:Bristol, UK
  • Real Name:Pete Treanor
  • IPB Version:v3.3.x
Contributor

Posted 31 May 2008 - 08:49 PM

View Postziomek, on May 31 2008, 09:21 PM, said:

if ($do_check) $this->check_sig($this->ipsclass->input['Post']);

Quote

//-----------------------------------------
// Post process the editor
// Now we have safe HTML and bbcode
//-----------------------------------------

$this->ipsclass->input['Post'] = $this->class->han_editor->process_raw_post( 'Post' );

# Check signature
if ($this->ipsclass->vars['sl_enable'] && ! empty($this->ipsclass->input['Post']))
{
$do_check = ($this->ipsclass->vars['sl_scope'] && preg_match("/(^|,)".$this->ipsclass->member['mgroup']."(,|$)/", $this->ipsclass->vars['sl_scope'])) ? 0 : 1;
if ($do_check) $this->check_sig($this->ipsclass->input['Post']);
}

Via looks the above not been done with Bot Edit need be replaced with this, also check if bottom part been done to.

		# Check signature
		if ($this->ipsclass->vars['sl_enable'] && ! empty($this->ipsclass->input['Post']))
		{
			$do_check = ($this->ipsclass->vars['sl_scope'] && preg_match("/(^|,)".$this->ipsclass->member['mgroup']."(,|$)/", $this->ipsclass->vars['sl_scope'])) ? 0 : 1;
			if ($do_check) $this->check_sig($this->ipsclass->input['Post']);
		}
		
		//-----------------------------------------
		// Parse post
		//-----------------------------------------
		
		$this->class->parser->parse_smilies	 = 0;
		$this->class->parser->parse_html		= intval($this->ipsclass->vars['sig_allow_html']);
		$this->class->parser->parse_bbcode	  = intval($this->ipsclass->vars['sig_allow_ibc']);
		$this->class->parser->parsing_signature = 1;

		$this->ipsclass->input['Post']		  = $this->class->parser->bad_words( $this->class->parser->pre_db_parse( $this->ipsclass->input['Post'] ) );
		
		if ($this->class->parser->error != "")
		{
			$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => $this->class->parser->error) );
		}
		
		# Allow links in signatures?
		if (isset($do_check) && $do_check && ! $this->ipsclass->vars['sl_links'])
		{
			$this->ipsclass->input['Post'] = preg_replace("#<a href=[\"'](https?://|ftps?://|news://)?(\S+?)['\"].+?".">(.+?)</a>#", "_\\3", $this->ipsclass->input['Post']);
		}

it be under

		$this->class->ignore_user_splash();
		return true;

and start with

	/*-------------------------------------------------------------------------*/
	// Signature Limitation
	/*-------------------------------------------------------------------------*/

	function check_sig(&$sig)
	{
		$sig = preg_replace("/<br\s*\/?>/i", "<br />", $sig);

Posted Image

Coming Soon


Motorhome Today


#10 Pete T

Pete T

    IP.Board Owner

  • Modders
  • PipPipPipPipPipPipPipPip
  • 1,031 posts
  • Location:Bristol, UK
  • Real Name:Pete Treanor
  • IPB Version:v3.3.x
Contributor

Posted 31 May 2008 - 08:53 PM

View Postemoney, on May 31 2008, 09:40 PM, said:

View PostPeteT, on May 31 2008, 03:18 PM, said:

View Postemoney, on May 31 2008, 04:57 PM, said:

Thanks for upgrading this!  I'm wondering though... is there something wrong with the 1.0.4 version of this mod on 2.3?  I'm using that and there are a few added features I would like but it seems to work well enough.

And while I'm here...What about an overall dimensions limit?  I know you can do image size max and max lines and character per line, but people can still max out both the images and text lines at the same time to effectively have a sig twice as long as I would like.  That make sense?

Not to sure what mean get idea that saying to me if set your image 150 x 150 then set your lines 4, people still maxing that out ! is that what sort trying tell me.
Let me try to give an example:

I don't want sigs to be over 250 pixels in height or 700 pixels in width.

I set the images to 2 max images, and 125X700 for each, so if they use 2 images it equals 250X700
I set the max number of lines to 20 lines, since that is about 250 pixels high give or take.  
But a user can type 20 lines of text and then place 2 images at 125 height each, so then their overall sig when counting the text lines and the 2 images turns out to be 500 pixels high, obviously way over the limit I want in place.

So I would like a featured added that is for OVERALL height and width limitation.  So users can't max out the text and images to make 1 huge sig.

that make more sense?
Yes that makes better sense now and i will look this 2morrow for you and get back to you.

Posted Image

Coming Soon


Motorhome Today


#11 ivf

ivf

    Member

  • Members
  • PipPipPip
  • 22 posts
  • Real Name:Rick
  • IPB Version:v3.0.x

Posted 31 May 2008 - 10:43 PM

I've been wanting the feature to limit signatures in certain forums for years. Nice to see it appears this mod does it.

First of all I'm not a tech or even close. I tried installing it and don't think the file edits went through. Now I'm trying to figure out what to change and find it confusing. I think it's the xml file that I'm not reading correctly.

I tried searching for

Quote

<file>/sources/action_public/messenger.php</file>
<type>replacewith</type>
<find><![CDATA[a:1:{i:0;s:68:"if ( $this->ipsclass->member['view_sigs'] and $member['signature'] )";}]]></find>
<add><![CDATA[a:1:{i:0;s:84:"if ( $this->ipsclass->member['view_sigs'] and $member['signature'] and ! $not_show )";}]]></add>
</edit>

Question#1: am I looking for something in that file that starts with ![CDATA?[a:1:{i:0;s:68,  or is it starting from "if ( $this ?
Question#2: After I find what I'm looking do I add... and ! $not_show  ... or the entire line so that two if statements are in the file pertaining to this?

feature question:
Question #3 : Will this mod allow me to shut off signatures entirely in forums? If I select "not allow in forum" does that mean not allow the limitations created by this mod in certain forums or does it mean not allow a signature at all? Not sure if I'm working with a negative statement.

Your help is appreciated.

#12 emoney

emoney

    I'll do graffiti if you sing to me in french

  • Modders
  • PipPipPipPipPipPipPipPip
  • 1,269 posts
  • Real Name:Eric
  • IPB Version:v3.1.x
Contributor

Posted 01 June 2008 - 01:40 AM

1) and 2) It appears you are trying to manually make the edits instead of using the BoT File Editor to do the edits for you.  Go get the BoT File Editor mod (available here) and then follow the directions and you'll see its a lot easier than what you are trying to do.  What you are reading is not for your eyes, but rather the File Editor to use.

3) Not Allow in Forum means to not show sigs AT ALL in the forum you select.

#13 ivf

ivf

    Member

  • Members
  • PipPipPip
  • 22 posts
  • Real Name:Rick
  • IPB Version:v3.0.x

Posted 01 June 2008 - 02:32 AM

Thank you very much.

I have installed and run the bot file editor but it doesn't appear to be updating any of the files. I'm not sure where I'm going wrong with it. I'll keep trying.

#14 ivf

ivf

    Member

  • Members
  • PipPipPip
  • 22 posts
  • Real Name:Rick
  • IPB Version:v3.0.x

Posted 01 June 2008 - 04:03 AM

View PostPeteT, on May 31 2008, 03:15 PM, said:

View Postziomek, on May 31 2008, 08:32 PM, said:

Thanks for mod, but i have error
Fatal error: Call to undefined function: check_sig() in /home/fuji321/public_html/sources/lib/func_usercp.php on line 1815
whats wrong ?

can your please copy that linee 1815 then i can tell you, but could be the bot edit not done both parts the edits need for that file.
I get the same error when I try to input a change in my signature. I have no idea what line line 1815 is but it's the same for me.

I manually updated all the files as I couldn't get the file editor to work.

#15 ziomek

ziomek

    Member

  • Members
  • PipPipPip
  • 47 posts
  • IPB Version:v2.3.x

Posted 01 June 2008 - 06:02 AM

Looks like for me and not works

/*-------------------------------------------------------------------------*/
	// Signature Limitation
	/*-------------------------------------------------------------------------*/

	function check_sig(&$sig)
	{
		$sig = preg_replace("/<br\s*\/?>/i", "<br />", $sig);
		
			 	
			# Check signature
		if ($this->ipsclass->vars['sl_enable'] && ! empty($this->ipsclass->input['Post']))
		{
			$do_check = ($this->ipsclass->vars['sl_scope'] && preg_match("/(^|,)".$this->ipsclass->member['mgroup']."(,|$)/", $this->ipsclass->vars['sl_scope'])) ? 0 : 1;
			if ($do_check) $this->check_sig($this->ipsclass->input['Post']);
		}
		
		//-----------------------------------------
		// Parse post
		//-----------------------------------------
		
		$this->class->parser->parse_smilies	 = 0;
		$this->class->parser->parse_html		= intval($this->ipsclass->vars['sig_allow_html']);
		$this->class->parser->parse_bbcode	  = intval($this->ipsclass->vars['sig_allow_ibc']);
		$this->class->parser->parsing_signature = 1;

		$this->ipsclass->input['Post']		  = $this->class->parser->bad_words( $this->class->parser->pre_db_parse( $this->ipsclass->input['Post'] ) );
		
		if ($this->class->parser->error != "")
		{
			$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => $this->class->parser->error) );
		}
		
		# Allow links in signatures?
		if (isset($do_check) && $do_check && ! $this->ipsclass->vars['sl_links'])
		{
			$this->ipsclass->input['Post'] = preg_replace("#<a href=[\"'](https?://|ftps?://|news://)?(\S+?)['\"].+?".">(.+?)</a>#", "_\\3", $this->ipsclass->input['Post']);
		}
		$this->class->ignore_user_splash();
		return true;


Parse error: syntax error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/fuji321/public_html/sources/lib/func_usercp.php on line 2189

http://img50.imagesh...beztytuuqb4.jpg
I update manually and I get error

Edited by ziomek, 01 June 2008 - 06:06 AM.


#16 Pete T

Pete T

    IP.Board Owner

  • Modders
  • PipPipPipPipPipPipPipPip
  • 1,031 posts
  • Location:Bristol, UK
  • Real Name:Pete Treanor
  • IPB Version:v3.3.x
Contributor

Posted 01 June 2008 - 11:10 AM

[quote name='ziomek' date='Jun 1 2008, 07:02 AM' post='124787']

File: /sources/lib/func_usercp.php

Find :


Replace With :



Then Find :



Add Below



Then save and upload that will work, if not and still getting errors then please submit PM with Admin Username / Password and Ftp Username/ Password with board url and ftp url.

Posted Image

Coming Soon


Motorhome Today


#17 Pete T

Pete T

    IP.Board Owner

  • Modders
  • PipPipPipPipPipPipPipPip
  • 1,031 posts
  • Location:Bristol, UK
  • Real Name:Pete Treanor
  • IPB Version:v3.3.x
Contributor

Posted 01 June 2008 - 11:12 AM

View Postivf, on Jun 1 2008, 05:03 AM, said:

View PostPeteT, on May 31 2008, 03:15 PM, said:

View Postziomek, on May 31 2008, 08:32 PM, said:

Thanks for mod, but i have error
Fatal error: Call to undefined function: check_sig() in /home/fuji321/public_html/sources/lib/func_usercp.php on line 1815
whats wrong ?

can your please copy that linee 1815 then i can tell you, but could be the bot edit not done both parts the edits need for that file.
I get the same error when I try to input a change in my signature. I have no idea what line line 1815 is but it's the same for me.

I manually updated all the files as I couldn't get the file editor to work.

The edit system works cause making sure the folders also 777 not just file, but if look post that part edits it will work for you if not like post shown all mod edits and get error send PM with all infomation like admin username etc etc.

Posted Image

Coming Soon


Motorhome Today


#18 ziomek

ziomek

    Member

  • Members
  • PipPipPip
  • 47 posts
  • IPB Version:v2.3.x

Posted 01 June 2008 - 12:08 PM

still not works ;(

#19 ivf

ivf

    Member

  • Members
  • PipPipPip
  • 22 posts
  • Real Name:Rick
  • IPB Version:v3.0.x

Posted 01 June 2008 - 02:40 PM

I have installed, reinstalled numerous times. Still getting the same error.

Permissions all at 777. Part of the lib file requires manual update. I have cut and replaced the file edit three or four times. When I check what needs to be done it is green checked for everything but that section and it continues to say it needs a manual update:

Posted Image

The mod installs also have a red exclamation mark as to the "file up to date". All files are uploaded and the signature file I have is dated May 30 22:31.

Posted Image

So now I don't know where to go with this.

#20 ivf

ivf

    Member

  • Members
  • PipPipPip
  • 22 posts
  • Real Name:Rick
  • IPB Version:v3.0.x

Posted 01 June 2008 - 04:43 PM

Thank you very much for your support and service Pete. I hope I sent you enough to buy a Guinness.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users