Hide Tag Special

Started by enik, April 11, 2005, 03:41:07 PM

Previous topic - Next topic

Kimmie

I just upgraded to RC3 (from RC1.2). Is there anything special I need to do before I reinstall this mod? Like making any type of changes to any of the db tables from the previous version I had, etc?

I want to make sure that when I reinstall it, its going to work right  :)


Thanks in advance!

ディン1031

Nothing needed, there are no database changes...
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

spandexforfun

Quote from: ディン1031 on May 03, 2010, 02:17:36 PM
Quote from: spandexforfun on May 02, 2010, 12:26:46 PM
I got problem about WYSIWYG editor in Smf 2.0 RC3 with Hide tag

When I need to modify [Hide] .... [/hide] message in my forum. I click on "Modify".
But in modify message page. The old message not appear in text editor form.





I try to fix this but not work. And I view source code of modify page I can see old message in that.



But when I remove hide code in that message . Anything normal.

So anyone can help me please. ;D ;D ;D
So i tested you thing it's working normal... i tested with all ways to edit a post... and every way work fine... any special settings?
I would assume that changes are missing...

I found that problem happen with long message with many bb code tag.

Now I remove hide tag first to modify message then put it back to message.


Kimmie

k I have a couple of issues with getting this mod reinstalled on RC3

1. In Sources/Subs.php its looking for:

static $disabled;

and it cant find it. I edited that file manually and that statement is no where in that file.

2. In Sources/Post.php its looking for:
if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '')

And it test failed so I edited the file and there are actually 2 instances of that code. Even though the mod install showed a "test failed" on that, it actually installed it right after this code:

// Preparse code. (Zef)
if ($user_info['is_guest'])
$user_info['name'] = $_POST['guestname'];
preparsecode($_POST['message']);


Is that where it was supposed to add it to, or did it test fail because it was supposed to add it to BOTH areas where it has that and it couldnt. The other it didnt add it before, comes right after this code:

$_POST['message'] = $smcFunc['htmlspecialchars']($_POST['message'], ENT_QUOTES);

preparsecode($_POST['message']);

ディン1031

#1284
Quote from: Kimmie on May 04, 2010, 06:38:51 PM
k I have a couple of issues with getting this mod reinstalled on RC3

1. In Sources/Subs.php its looking for:

static $disabled;

and it cant find it. I edited that file manually and that statement is no where in that file.

2. In Sources/Post.php its looking for:
if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '')

And it test failed so I edited the file and there are actually 2 instances of that code. Even though the mod install showed a "test failed" on that, it actually installed it right after this code:

// Preparse code. (Zef)
if ($user_info['is_guest'])
$user_info['name'] = $_POST['guestname'];
preparsecode($_POST['message']);


Is that where it was supposed to add it to, or did it test fail because it was supposed to add it to BOTH areas where it has that and it couldnt. The other it didnt add it before, comes right after this code:

$_POST['message'] = $smcFunc['htmlspecialchars']($_POST['message'], ENT_QUOTES);

preparsecode($_POST['message']);

First, every serachterm is in the files...

Downloaded the Orginal Version:
Subs.php
Code (Line: 872) Select
static $disabled;

Post.php
Code (Line: 1508) Select
$user_info['name'] = $_POST['guestname'];
preparsecode($_POST['message']);

Code (Line: 2719) Select
if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '')

All Positions exists and should be do the correct insert...

I would assume you've installe the media gallery, that mod will never be install compatible, it's impossible for me to do that...

I test every of my mod with a standard SMF Installation so that the install should work at least on a fresh install... and i do it on a windows system and bsd system... so i can not do more than that ;).
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

Kimmie

#1285
Quote from: ディン1031 on May 05, 2010, 01:28:30 AM
Quote from: Kimmie on May 04, 2010, 06:38:51 PM
k I have a couple of issues with getting this mod reinstalled on RC3

1. In Sources/Subs.php its looking for:

static $disabled;

and it cant find it. I edited that file manually and that statement is no where in that file.

2. In Sources/Post.php its looking for:
if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '')

And it test failed so I edited the file and there are actually 2 instances of that code. Even though the mod install showed a "test failed" on that, it actually installed it right after this code:

// Preparse code. (Zef)
if ($user_info['is_guest'])
$user_info['name'] = $_POST['guestname'];
preparsecode($_POST['message']);


Is that where it was supposed to add it to, or did it test fail because it was supposed to add it to BOTH areas where it has that and it couldnt. The other it didnt add it before, comes right after this code:

$_POST['message'] = $smcFunc['htmlspecialchars']($_POST['message'], ENT_QUOTES);

preparsecode($_POST['message']);

First, every serachterm is in the files...

Downloaded the Orginal Version:
Subs.php
Code (Line: 872) Select
static $disabled;

Post.php
Code (Line: 1508) Select
$user_info['name'] = $_POST['guestname'];
preparsecode($_POST['message']);

Code (Line: 2719) Select
if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '')

All Positions exists and should be do the correct insert...

I would assume you've installe the media gallery, that mod will never be install compatible, it's impossible for me to do that...

I test every of my mod with a standard SMF Installation so that the install should work at least on a fresh install... and i do it on a windows system and bsd system... so i can not do more than that ;).


I havent installed any media gallery. Not sure what it has to do with this mod. I just opened up the original subs.php file that came with the upgrade zip, did a ctrl f and did a search for that term and  its nowhere in that file. I have attached both here so you can see for yourself. The original one is the first one, and mine is the 2nd one.


Here is my search of the original file with 0 results:




This line of code in post.php appears "twice" thoughout the file:
if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '')

During the install it showed a "test failed" on that code. When I edited that file, it shows the mod code above the first one but not the second one. The mod page only shows "one" edit for that so there is something wrong with that part as well. I have also attached my post.php so you can see it and here is where it showd the test failed on it:


ディン1031

#1286
No it's exact one time in the files, i downloaded a fresh RC3 and there is only one position found... hope you serach with the tabs and not with something else.

I can not do more than create a new forum and click install and than there is no error...

And i give you the exact lines and if you compare it this are the exact matches...

I looked into you're file you've installed this mod i mentioned! Possible it's the aeva (media) and not the media gallery :P. (Both made the same problems for me...)

Look at the orginal file in the install package and you will see my mod install fine!
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

Kimmie

#1287
Quote from: ディン1031 on May 05, 2010, 04:29:19 AM
No it's exact one time in the files, i downloaded a fresh RC3 and there is only one position found... hope you serach with the tabs and not with something else.

I can not do more than create a new forum and click install and than there is no error...

And i give you the exact lines and if you compare it this are the exact matches...

I looked into you're file you've installed this mod i mentioned! Possible it's the aeva (media) and not the media gallery :P. (Both made the same problems for me...)

Look at the orginal file in the install package and you will see my mod install fine!

I did look at the original file, thats the picture I posted above and the attachment I posted. I opened the file in notepad, and used notepads feature to "find" and it could not find that term anywhere - as I showed you in the pic. What is the code that the line    static $disabled;  is supposed to come after so I can look for that code instead? I can see where another mod may alter a file however we are talking about the original file now. I looked at both the Upgrade post.php file and I also downloaded the full RC3 zip for a new install and didnt find it in that one either. As you can also see in my subs.php file, that code is in there twice. Are you saying that the aeva added that code again? Somethings definitely not right somewhere. I will uninstall both this mod and the aeva mod and then reinstall this one and see if that helps.

Edit: ok I have unininstalled both mods. I went to try and install the hide mod again, and the test failed on the post.php file has been fixed, however it still cannot find the    static $disabled; code in subs.php



I took the liberty of parsing the aeva mod and no where in the edits does it make a reference to change the term static $disabled. Please tell me exactly what code (in the original subs.php file) that this term is supposed to fall before and after so I can look for those codes. I have attached the "exact file" that is included with the "smf_2-0-rc3_upgrade" zip file.  If its in there, I sure dont see it..lol

ディン1031

#1288
No it's not twice in it it's exact one time in it... and i don't use the upgrade i use the install package oO.

I look at you subs.php file i opend my editior insert static $disabled;
and the editor tell me Line 872 exact match...

So i serach for
if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '')
And exact one match in the Post.php... Line 2719...

You can install the other two, i could tell you where you need to insert it on you files... i looked at and i know where the changes are :P. (Also i don't know if there is a other mod that is not compatible with my replacments...)

So i looked at the large update and there is exact the same result...
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

Kimmie

Quote from: ディン1031 on May 07, 2010, 12:33:19 AM
No it's not twice in it it's exact one time in it... and i don't use the upgrade i use the install package oO.

I look at you subs.php file i opend my editior insert static $disabled;
and the editor tell me Line 872 exact match...

I want your glasses..lol. This is my line 872:



QuoteSo i serach for
if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '')
And exact one match in the Post.php... Line 2719...

And this is my line 2719:





QuoteYou can install the other two, i could tell you where you need to insert it on you files... i looked at and i know where the changes are :P. (Also i don't know if there is a other mod that is not compatible with my replacments...)

So i looked at the large update and there is exact the same result...

that would be helpful..lol


I would also like to know what "editor" your using




ディン1031

#1290
http://www.simplemachines.org/community/index.php?topic=32954.msg2614097#msg2614097 <- this are you current files?

Boths Subs.php files:
Than it's line 883:

static $disabled, $default_disabled, $parse_tag_cache;

Search for this and add the code after it ;).

Second the Post File Changes:
Line: 2869

if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img><object><embed>')) === '')


I hope you now what to do now...

(And i think this are the aeva media incompatible parts...)

I use textpad, notpad++ or uedit for my php searches and changes ;P (depend on pc and system)

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

Kimmie

#1291
Quote from: ディン1031 on May 11, 2010, 12:15:26 AM
http://www.simplemachines.org/community/index.php?topic=32954.msg2614097#msg2614097 <- this are you current files?

Boths Subs.php files:
Than it's line 883:

static $disabled, $default_disabled, $parse_tag_cache;

Search for this and add the code after it ;).

Second the Post File Changes:
Line: 2869

if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img><object><embed>')) === '')


I hope you now what to do now...

(And i think this are the aeva media incompatible parts...)

I use textpad, notpad++ or uedit for my php searches and changes ;P (depend on pc and system)

Bye
DIN1031

I uninstalled the AEVA mod several days ago after you said it messed up this mod. My last post I made above was searching for those strings without that mod being installed so its not that mod that is causing the problem now. :).


I know why it cant find it.....



Its looking for a " ; " but its actually a comma ( , ).


ok I made the changes but there are issues. The hide tags are not working (their still showing up in posts and not actually hiding the content)



and when I try and modify a post I get this error:

Fatal error: Call to undefined function hideTagExists() in /home/****/public_html/Sources/Subs-Editor.php on line 131


and when I try to uninstall the mod I get a ton of test faileds not just on those two files and that was after I put the original post and sub.php files back.




EDIT: Ok I think I am getting it all straigtened out  lol (sheesh what a mess..lol)

ディン1031

#1292
oO normal the function should be in the Subs.php...

An in the orginal files there is ; after the $disabled. Because the line have no other things in it =). (I thoght Avae add this parsed tags things... so it seems like a other mod did it...)

Normal after you installed the hide tag the avae should be installable without problems as far i know...
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x


ディン1031

Hmmm i was sure that i allready replaced them oO...
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

CommanderMadi

Hello, I installed this mod but a test failed during installation, it was in ./Sources/Post.php, and I went to edit it manually and couldnt find them even....

Find
if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '')


         Replace
// Okay i will say there is something, so that i check for an real empty post :)
$context['user_post_avaible'] = 1;

if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '')


The problem is that I could not find the Original code in my ./Sources/Post.php
Relationships counselling and advice blog
http://www.adorology.com

ディン1031

Because there are three mod i know which change this part...

Search only for if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false),
and add this before.

// Okay i will say there is something, so that i check for an real empty post :)
$context['user_post_avaible'] = 1;
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

CommanderMadi

Ok mate, thank you very much, but I found another error in subs which says

Find:
static $disabled;

Add After:
static $disabled;

// On the first Parsing i will gernerate all things i need ;) after that it's not needable :)
if (!isset($modSettings['hide_preparedOption']))
{
// First there is nothing in it ;)
$modSettings['hide_preparedOption']['hiddentext'] = '&nbsp;';
$modSettings['hide_preparedOption']['unhiddentext'] = '&nbsp;';

if (empty($modSettings['hide_noinfoforguests']) || !$user_info['is_guest'])
{
// Prepare the hidden information :)
$modSettings['hide_preparedOption']['hiddentext'] = isset($modSettings['hide_hiddentext']) ? $modSettings['hide_hiddentext'] : '';
$modSettings['hide_preparedOption']['hiddentext'] = str_replace('$language', $user_info['language'], $modSettings['hide_preparedOption']['hiddentext']);
if (!empty($modSettings['hide_MUIswitch']) && isset($txt['hide_hiddentext']))
$modSettings['hide_preparedOption']['hiddentext'] = str_replace('$txtvariable', $txt['hide_hiddentext'], $modSettings['hide_preparedOption']['hiddentext']);
if (!empty($modSettings['hide_enableHTML']))
$modSettings['hide_preparedOption']['hiddentext'] = un_htmlspecialchars($modSettings['hide_preparedOption']['hiddentext']);

// Prepare the unhidden infomation?
if (!empty($modSettings['hide_enableUnhiddenText']))
{
$modSettings['hide_preparedOption']['unhiddentext'] = isset($modSettings['hide_unhiddentext']) ? $modSettings['hide_unhiddentext'] : '';
$modSettings['hide_preparedOption']['unhiddentext'] = str_replace('$language', $user_info['language'], $modSettings['hide_preparedOption']['unhiddentext']);
if (!empty($modSettings['hide_MUIswitch']) && isset($txt['hide_unhiddentext']))
$modSettings['hide_preparedOption']['unhiddentext'] = str_replace('$txtvariable', $txt['hide_unhiddentext'], $modSettings['hide_preparedOption']['unhiddentext']);
if (!empty($modSettings['hide_enableHTML']))
$modSettings['hide_preparedOption']['unhiddentext'] = un_htmlspecialchars($modSettings['hide_preparedOption']['unhiddentext']);
}
}

// So prepare the unhidden Option for the Parser ;)
if (!empty($modSettings['hide_useSpanTag']))
{
$modSettings['hide_preparedOption']['before_info'] = '<span class="hiddencontent">';
$modSettings['hide_preparedOption']['after_info'] = '</span>';
}
else
{
$modSettings['hide_preparedOption']['before_info'] = '<div class="hiddencontent">';
$modSettings['hide_preparedOption']['after_info'] = '</div>';
}

// Okay Let's see where i must put the unhidden Informations :)
if (!empty($modSettings['hide_enableUnhiddenText']) && empty($modSettings['hide_onlyonetimeinfo']))
{
if (empty($modSettings['hide_posUnhiddenText']) || $modSettings['hide_posUnhiddenText'] == 4)
$modSettings['hide_preparedOption']['after_info'] .= $modSettings['hide_preparedOption']['unhiddentext'];
elseif ($modSettings['hide_posUnhiddenText'] == 3)
$modSettings['hide_preparedOption']['after_info'] = $modSettings['hide_preparedOption']['unhiddentext'].$modSettings['hide_preparedOption']['after_info'];
elseif ($modSettings['hide_posUnhiddenText'] == 2)
$modSettings['hide_preparedOption']['before_info'] .= $modSettings['hide_preparedOption']['unhiddentext'];
elseif ($modSettings['hide_posUnhiddenText'] == 1)
$modSettings['hide_preparedOption']['before_info'] = $modSettings['hide_preparedOption']['unhiddentext'].$modSettings['hide_preparedOption']['before_info'];
else
$modSettings['hide_preparedOption']['after_info'] .= $modSettings['hide_preparedOption']['unhiddentext'];
}

$modSettings['hide_preparedOption']['parse_content'] = !empty($modSettings['hide_enableUnhiddenText']) && empty($modSettings['hide_onlyonetimeinfo']);

// Okay this is the check up if he is allowed to unhide it everytime! (Risky if wrong setup or diffrent mods can handle hide tag)
$modSettings['hide_preparedOption']['auto_unhide_parser'] = false;
if (!empty($modSettings['hide_unhideparser']) && !empty($modSettings['hide_autounhidegroups']))
{
$modSettings['hide_autounhidegroups'] = !is_array($modSettings['hide_autounhidegroups']) ? explode(',', $modSettings['hide_autounhidegroups']) : $modSettings['hide_autounhidegroups'];
foreach ($user_info['groups'] as $group_id)
if (in_array($group_id, $modSettings['hide_autounhidegroups']))
{
$modSettings['hide_preparedOption']['auto_unhide_parser'] = true;
break; //One is enouph ;D
}
}
}

// Hide Mod.. i remove the code before i do anything...
if ($message !== false && !empty($message))
{
if ($modSettings['hide_preparedOption']['auto_unhide_parser'])
$context['user_post_avaible'] = 1;
// Add the Hidden Text at the end of the post :)
if ((empty($context['user_post_avaible']) || !isset($context['user_post_avaible'])) && !empty($modSettings['hide_onlyonetimeinfo']) && hideTagExists($message, $cache_id))
$message .= '[br]'.$modSettings['hide_preparedOption']['hiddentext'];
// Here i remove this content :) or show onetime unhide info :)
if (!isset($context['user_post_avaible']) || empty($context['user_post_avaible']))
{
// Remove it ;D
$message = preg_replace("/\[hide\](.+?)\[\/hide\]/i", (empty($modSettings['hide_onlyonetimeinfo']) ? $modSettings['hide_preparedOption']['hiddentext'] : "&nbsp"), $message);
$message = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), (empty($modSettings['hide_onlyonetimeinfo']) ? $modSettings['hide_preparedOption']['hiddentext'] : "&nbsp"), $message);
}
// Okay i need to add the unhidden information at the end of the post :)
elseif (!empty($context['user_post_avaible']) && !empty($modSettings['hide_onlyonetimeinfo']) && !empty($modSettings['hide_enableUnhiddenText']) && hideTagExists($message, $cache_id))
$message .= '[br]'.$modSettings['hide_preparedOption']['unhiddentext'];
}


I can not also find this "static $disabled;" to change it

By the way this file is in the subs.php

thank you in advance

Relationships counselling and advice blog
http://www.adorology.com

Arantor

So what other mods do you have?
Holder of controversial views, all of which my own.


CommanderMadi

1.Sitemap   
2.Member Color Link   
3.Advanced Contact Form   
4.Team Page   
5.UrbanDictionary.com BBC        
6.Registered Links       
7.Pretty URLs        
8.Aeva Media       
9.SimplePortal      
10.Global Headers Footers
Relationships counselling and advice blog
http://www.adorology.com

Advertisement: