[ABD]Advanced Hide Post 1.0.0 (From Sell Post 0.2.1)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
shi
Registered User
Posts: 58
Joined: Fri Sep 12, 2003 7:14 am
Location: Shanghai, China
Contact:

Post by shi » Fri Nov 28, 2003 7:31 am

transwarp™ wrote: Sure I got the right permissions and as ADMIN I should always see it ? I disabled all the BEGIN and END loops inside posting_body.tpl and only got to empty fields and a dropdown box also empty there !! -

The bug inside TOPIC_REVIEW is fixed thanks. But the other thing from the installation is I got no entries inside a USER table to change the fields there ? - Here is want inside your install text

No table with pbpbb_users entries there ?!


Don't disable the BEGIN and ENDs. This MOD will not do any change in users table (phpbb_users). That's what it requires to support selling post and so on. You may at least have the featurs like hiding post untill the user replies even without Points/Cash MOD.

I don't know what's wrong with your case. If you are testing it in a site I can connect to, I'd like to go there and have a look. But I won't be online in the next 2 days. All I can give you now is the steps:
  1. Unzip the archive.
  2. Upload advanced_hide_post_1.0.1b_db_install.php (there's a bug in 1.0.0 so I take 1.0.1 as an example) to the root of your forum. And run it with your browser.
    Or, you may use phpMyAdmin to run the SQLs in installation file instead.
  3. Follow the instructions in advanced_hide_post_1.0.1b_en.mod to modfy the files. Don't ignore the comments.
  4. Log into your forum as administrator and go to administration panel.
  5. Click on Configration in General Admin in the left menu.
  6. Scroll down to the Hide Post section.
  7. Set Allow hiding till reply and the others to yes.
  8. Go to the forum to post and you should get the hiding type selection box.
If these cannot help you, please post here or in my site and be patient to wait for me. You may alos paste the screenshots of your testing in my site if you'd like to, which may be helpful for analyzing the problem.

shi
Registered User
Posts: 58
Joined: Fri Sep 12, 2003 7:14 am
Location: Shanghai, China
Contact:

Post by shi » Fri Nov 28, 2003 8:01 am

The following is to fix the bug that the cash/points type cannot be shown correctly when Others is selected in Administration Panel.

Code: Select all

# 
#-----[ OPEN ]------------------------------------------ 
# 
admin/admin_board.php 

# 
#-----[ FIND ]------------------------------------------ 
# 
   "CASHTYPE_OTHERS" => $cashtyp_others, 

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
# 
$cashtyp 

# 
#-----[ IN-LINE REPLACE WITH ]------------------------------------------ 
# 
$cashtype

shi
Registered User
Posts: 58
Joined: Fri Sep 12, 2003 7:14 am
Location: Shanghai, China
Contact:

Post by shi » Mon Dec 01, 2003 9:41 am

transwarp™, what's your testing now? Can you give me further information?

User avatar
TimeVirus
Registered User
Posts: 125
Joined: Sat Jul 12, 2003 12:17 am

Post by TimeVirus » Tue Dec 09, 2003 4:41 am

I've been away for awhile and I'm just now trying to do the upgrade path but that didnt work out, I missed the quote fix somehow.

So I'm restoring all my pre modded files and starting over using advanced_hide_post_1.0.1_en.mod


This is one thing I've found, this y code is already being used by left right image mod.

Code: Select all

'L_BBCODE_Y_HELP' => $lang['bbcode_y_help'],
It looks like I have x available, so I'll try proceeding by subsituting that.
I'm probably wrong again...

User avatar
TimeVirus
Registered User
Posts: 125
Joined: Sat Jul 12, 2003 12:17 am

Post by TimeVirus » Tue Dec 09, 2003 6:59 am

Ok the "y" help was only thing I noticed doing this over from scratch using 1.0.1b then applying the Advanced_hide_post_4_cash_mod2.mod

But all the formerly hidden posts dont have any hidden info now.

When I go to edit or make a new post, there is no selling post selections in view, as if the switch in posting_body.tpl isn't switching on.

I did the three things you mentioned under bugs found but I couldn't find either hiding_cash_type or hiding_cash_id in phpbb_users.

----------------------
Edit, just found them both in phpbb_posts. Should both be there?

Finally found the drop down box (was expecting boxes like before). I set all options to yes in admin, but all that are in the drop down box is: normal, hide post till user reply, hide post until users posts reach. Shouldn't there be one to sell posts? I tried entering a number into "normal post" setting but that didnt work.

When I try the intro BBcode it displays like this.
[intro:2f8f2be62c]test2[/intro:2f8f2be62c]

The hide till users reply seems to be working except it has the quote bug of showing contents if you press quote button before replying.
I'm probably wrong again...

shi
Registered User
Posts: 58
Joined: Fri Sep 12, 2003 7:14 am
Location: Shanghai, China
Contact:

Post by shi » Tue Dec 09, 2003 1:52 pm

TimeVirus wrote: This is one thing I've found, this y code is already being used by left right image mod.

Code: Select all

'L_BBCODE_Y_HELP' => $lang['bbcode_y_help']
It looks like I have x available, so I'll try proceeding by subsituting that.

I assigned it a 'y' since I found that it's free in BBCode Reservation List. If you change it to 'x', some other codes should be changed too. I can post it if you think it's necessary.
TimeVirus wrote: I did the three things you mentioned under bugs found but I couldn't find either hiding_cash_type or hiding_cash_id in phpbb_users.
----------------------
Edit, just found them both in phpbb_posts. Should both be there?
[/qoute]
What a stupid mistake I made! Yes, they're in phpbb_posts.

[quote"TimeVirus"]Finally found the drop down box (was expecting boxes like before). I set all options to yes in admin, but all that are in the drop down box is: normal, hide post till user reply, hide post until users posts reach. Shouldn't there be one to sell posts? I tried entering a number into "normal post" setting but that didnt work.

TimeVirus wrote: When I try the intro BBcode it displays like this.
[intro:2f8f2be62c]test2[/intro:2f8f2be62c]

Check the position of the following codes in your bbcode.php:

Code: Select all

$text = preg_replace("#\[intro\](.*?)\[/intro\]#si", "[intro:$uid]\\1[/intro:$uid]", $text);
They should belong to the function of bbencode_first_pass(). So, if you put it in bbencode_second_pass(), what you described happens. In another word, they should be like

Code: Select all

$text = preg_replace("#\[intro\](.*?)\[/intro\]#si", "[intro:$uid]\\1[/intro:$uid]", $text); 

  // Remove our padding from the string.. 
  return substr($text, 1); 

} // bbencode_first_pass()
And the corresponding actions in my mod should be

Code: Select all

# 
#-----[ FIND ]------------------------------------------ 
# 
   // Remove our padding from the string.. 
   return substr($text, 1);; 

} // bbencode_first_pass() 

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
   $text = preg_replace("#\[intro\](.*?)\[/intro\]#si", "[intro:$uid]\\1[/intro:$uid]", $text);
Are they the same as which in the file you download?
TimeVirus wrote: The hide till users reply seems to be working except it has the quote bug of showing contents if you press quote button before replying.
That's strange. It works fine here. Can you check your installation again?

User avatar
transwarp™
Registered User
Posts: 92
Joined: Fri Jul 19, 2002 11:34 pm

Post by transwarp™ » Tue Dec 09, 2003 5:25 pm

This with the INTRO happened to me for the first time also - Do not add this to the first location you find, do it the the second and get it working like written here !! -

Finally I got this MOD now working for me and it looks good so far - I try to add the addon to the CASH MOD but the fields data I enter are not stored inside the CASH settings - The fields still being empty if setup a value there !!

I remember the hidden message MOD showing that there is a hidden message inside and later you see the hidden parts inside a nice border or something and an explain if not posted before !! - This is something i miss there aswell ! -

Sure you got the small window at the bottom but most would miss this if try to see a text written !! -

Second I have a strange feeling is that everyone up from MOD until ADMIN can see the message without reply or anything ! - I do not like this way - Is there no way to change who could see this messages and who not ? So doing an except for MODERATOR, SUPER MODERATOR not to see ADMIN or JUNIOR ADMINS made postings ?? -

We use the CASH MOD so everyone should spend the points and not only collecting points if being able to see everything without further actions !! - What would the POINTS be useful for doing this way ?? -

Is there a way to control who can see the posts and who is handled like a normal user level ??
- TERRA OCEANICA -

User avatar
SixthSphere
Registered User
Posts: 116
Joined: Fri Aug 08, 2003 4:32 pm

Post by SixthSphere » Tue Dec 09, 2003 5:31 pm

got this mod installed and working fine on my 2.0.5 board runnin the Points System (not CashMod)...

only issue I had was that my Group Permissions and User Permissions files dissappeared from the ACP

Replacing the two php files with original un-edited copies fixed this problem, but cannot set groups or single users to be able to sell, etc.

Works great tho... awesome idea!

--( SixthSphere )--

User avatar
TimeVirus
Registered User
Posts: 125
Joined: Sat Jul 12, 2003 12:17 am

Post by TimeVirus » Tue Dec 09, 2003 9:06 pm

About the "y" help, doesnt matter to me what it is, it's just that I already added another mod (maybe not mod DB compliant) using it. I saw the Y used in two spots in your code so I changed it to X instead. It looks like I just need to change it in posting.php and lang_main.php files?

On my bbcode intro error: It does look like I put it in the first instance of bbcode.php instead of second as transwarp described.

------------------------------------------------------------------------
The biggest thing I'm wondering about is I restored all the files to the beta version I had working a ways back, but there is no hidden messages now. I tried to make a new post for sale and get this error:

Code: Select all

SQL Error : 1054 Unknown column 'selling_price' in 'field list'

INSERT INTO phpbb_posts (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig, selling_price) VALUES (339, 16, 2, '', 1071000075, '04410512', 1, 1, 1, 1, 50)

Line : 284
File : /home/mydir/public_html/forum/includes/functions_post.php
I'm assuming one of the sql updates I ran from browser deleted that column? I didnt know updaters would do that, thought it would just add new ones. I guess there is no hope of getting back the post sale prices, etc now? I'm dont want to restore the db and lose other posts just to fix it.
---------------------------------------------------------------------

My new plan:

1. Restore the forum files to before "sell post beta"
2. Apply the full install advanced_hide_post_1.0.1b_en.zip
3. Apply the cash patch advanced_hide_post_4_cash_mod2.zip
4. Do the three things mentioned in "3 bugs found" post

Does that sound correct? Oh BTW, I'm using Cash Mod 2.0.2, not 2.2. Does that matter? And thanks for helping and making this cool mod again. :)
I'm probably wrong again...

shi
Registered User
Posts: 58
Joined: Fri Sep 12, 2003 7:14 am
Location: Shanghai, China
Contact:

Post by shi » Wed Dec 10, 2003 12:47 pm

transwarp? wrote: Finally I got this MOD now working for me and it looks good so far - I try to add the addon to the CASH MOD but the fields data I enter are not stored inside the CASH settings - The fields still being empty if setup a value there !!

I remember the hidden message MOD showing that there is a hidden message inside and later you see the hidden parts inside a nice border or something and an explain if not posted before !! - This is something i miss there aswell ! -

Sure you got the small window at the bottom but most would miss this if try to see a text written !! -

Second I have a strange feeling is that everyone up from MOD until ADMIN can see the message without reply or anything ! - I do not like this way - Is there no way to change who could see this messages and who not ? So doing an except for MODERATOR, SUPER MODERATOR not to see ADMIN or JUNIOR ADMINS made postings ?? -

We use the CASH MOD so everyone should spend the points and not only collecting points if being able to see everything without further actions !! - What would the POINTS be useful for doing this way ?? -

Is there a way to control who can see the posts and who is handled like a normal user level ??

I'm sorry I'm not able to understand you well. Please forgive my English. would you please show me a picture for illustrating?

For the last question. I think it's unnecessary to hide the contents to the one who can edit the post directly. Further more, how do you feel if you, as a moderator find all the hidden information are junk after buying? Anyway, if you do like to hide for every one, just replace

Code: Select all

if ($is_auth['auth_mod'])
	$hiding_info['state'] = 'Can_read';
else
{
	eval($check_view);
	if ( $canview )
	{
		$hiding_info['state'] = 'Can_read';
	}
	else
	{
		$hiding_info['state'] = 'Cannot_read';
		$hiding_info['show_attachment'] = false;
		$hiding_info['post_id'] = $post['post_id'];
	}
}
in the file includes/functions_hide.php with

Code: Select all

eval($check_view);
if ( $canview )
{
	$hiding_info['state'] = 'Can_read';
}
else
{
	$hiding_info['state'] = 'Cannot_read';
	$hiding_info['show_attachment'] = false;
	$hiding_info['post_id'] = $post['post_id'];
}
===================================================================
SixthSphere wrote: only issue I had was that my Group Permissions and User Permissions files dissappeared from the ACP

Replacing the two php files with original un-edited copies fixed this problem, but cannot set groups or single users to be able to sell, etc.

Could you send me the 2 modified php files? You may upload it to my site after zipped.

===================================================================
TimeVirus wrote: About the "y" help, doesnt matter to me what it is, it's just that I already added another mod (maybe not mod DB compliant) using it. I saw the Y used in two spots in your code so I changed it to X instead. It looks like I just need to change it in posting.php and lang_main.php files?

posting_body.tpl should be edited as well.
TimeVirus wrote: The biggest thing I'm wondering about is I restored all the files to the beta version I had working a ways back, but there is no hidden messages now. I tried to make a new post for sale and get this error:

Code: Select all

SQL Error : 1054 Unknown column 'selling_price' in 'field list'

INSERT INTO phpbb_posts (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig, selling_price) VALUES (339, 16, 2, '', 1071000075, '04410512', 1, 1, 1, 1, 50)

Line : 284
File : /home/mydir/public_html/forum/includes/functions_post.php
I'm assuming one of the sql updates I ran from browser deleted that column? I didnt know updaters would do that, thought it would just add new ones. I guess there is no hope of getting back the post sale prices, etc now? I'm dont want to restore the db and lose other posts just to fix it.
[/qoute]
What's the exact version of my mod are you using? If you apply Advanced Hide Post v1.0.1b from a phpBB without my mod, the selling_price should never appear, unless there's something wrong with the mod files. But SixthSphere also said it works. You really confused me.
TimeVirus wrote:My new plan:

1. Restore the forum files to before "sell post beta"
2. Apply the full install advanced_hide_post_1.0.1b_en.zip
3. Apply the cash patch advanced_hide_post_4_cash_mod2.zip
4. Do the three things mentioned in "3 bugs found" post

Does that sound correct? Oh BTW, I'm using Cash Mod 2.0.2, not 2.2. Does that matter? And thanks for helping and making this cool mod again. :)
Also a good idea but please ignore the 4th. These bugs was in version 1.0.0b than 1.0.1b. Try the last one and remind me only after you do experience these troubles.

User avatar
SixthSphere
Registered User
Posts: 116
Joined: Fri Aug 08, 2003 4:32 pm

Post by SixthSphere » Wed Dec 10, 2003 4:00 pm

Shi

I deleted the bad ones already...

I'm going to try and install it again on those two files and see what happens

Great Mod!

:D

--( SixthSphere)--

User avatar
transwarp™
Registered User
Posts: 92
Joined: Fri Jul 19, 2002 11:34 pm

Post by transwarp™ » Wed Dec 10, 2003 4:11 pm

Thanks !!

I think this line could be modded for various userlevels to allow or not to allow ! -

A good reminder would be if you setup the userlevel MOD, PRIVATE or ADMIN inside the forum the do such kind of postings only it would be good if this persons allowed to post such topics could see it and all others not ! - So if inside an forum the ADMIN is allowed to post only such topics with this system, here sure should be see it also ! - This would be a way the system should work like if having permissions to write the same should be work for people to see them -

So a member could be a forum MODERATOR but if not being inside this special forum he will work like a normal member !! - And only the MODS who are real MODS inside the forum could use it the normal way !!!
- TERRA OCEANICA -

User avatar
TimeVirus
Registered User
Posts: 125
Joined: Sat Jul 12, 2003 12:17 am

Post by TimeVirus » Thu Dec 11, 2003 9:42 am

This time I upgraded to Cash Mod 2.2 from 2.0.2. More fields seem to hold and store data when I updated to Cash Mod 2.2. Perhaps your instructions should mention 2.2 instead of simply 2. It's quite different from 2.0. In 2.2 the file admin_cash_settings.php doesn't exist as described in the cash mod fix.

When it talks about this do we also change AUTH_HIDE4REPLY to 13, etc?:

Code: Select all

# The number 12 should equal to the max number of the existing AUTH_* plus 1
# e.g. if you have Global Announcement installed, AUTH_GLOBALANNOUNCEMENT will
# take the number 12. So you have to set AUTH_SELLPOST to 13
define('AUTH_SELLPOST', 12);
define('AUTH_HIDE4REPLY', 13);
I did and it seems to work, last time I left the ones alone you didn't specifically mention.

So far the only entries that wont store data is "field name" and "name of cash/points". I tried setting the system to "other" when it wouldn't sell a post with CM2.2. I checked but the fix you posted above was already included.

When I set the system to "other" the dropdown box would display "sell this post for" option. But when hitting submit it gives an error about currency name not found. When I go back into admin , the fields I had submitted were empty again.

When system is set to CM2, sell post wasn't available as an option.

When I set it to "points" it seems to work fine on my first cash currency, which is the one I want to use anyways. So it's in a functioning condition now, if not quite perfect yet.

Just noticed the bug where if more than one post is sold in a thread multiple explain boxes show in posts below. I'm using phpBB 2.0.6
I'm probably wrong again...

shi
Registered User
Posts: 58
Joined: Fri Sep 12, 2003 7:14 am
Location: Shanghai, China
Contact:

Post by shi » Thu Dec 11, 2003 1:03 pm

TimeVirus wrote: This time I upgraded to Cash Mod 2.2 from 2.0.2. More fields seem to hold and store data when I updated to Cash Mod 2.2. Perhaps your instructions should mention 2.2 instead of simply 2. It's quite different from 2.0. In 2.2 the file admin_cash_settings.php doesn't exist as described in the cash mod fix.

So far the only entries that wont store data is "field name" and "name of cash/points". I tried setting the system to "other" when it wouldn't sell a post with CM2.2. I checked but the fix you posted above was already included.

When I set the system to "other" the dropdown box would display "sell this post for" option. But when hitting submit it gives an error about currency name not found. When I go back into admin , the fields I had submitted were empty again.

When system is set to CM2, sell post wasn't available as an option.

When I set it to "points" it seems to work fine on my first cash currency, which is the one I want to use anyways. So it's in a functioning condition now, if not quite perfect yet.

I developed the mod under cash mod 2.0.2. Xore told me that 2.2 was quite different from 2.0. All the issues above were caused by that. Seems the MOD need to be upgraded again.

TimeVirus wrote: When it talks about this do we also change AUTH_HIDE4REPLY to 13, etc?:

Code: Select all

# The number 12 should equal to the max number of the existing AUTH_* plus 1
# e.g. if you have Global Announcement installed, AUTH_GLOBALANNOUNCEMENT will
# take the number 12. So you have to set AUTH_SELLPOST to 13
define('AUTH_SELLPOST', 12);
define('AUTH_HIDE4REPLY', 13);
I did and it seems to work, last time I left the ones alone you didn't specifically mention.

I'm wondering why the file you get is not the same as the v1.0.1b in my disk. When did you download it? Here's the codes of mine:

Code: Select all

# The number 12 should equal to the max number of the existing AUTH_* plus 1
# e.g. if you have Global Announcement installed, AUTH_GLOBALANNOUNCEMENT will
# take the number 12. So you have to set AUTH_SELLPOST to 13
define('AUTH_SELLPOST', 12);
define('AUTH_HIDE4REPLY', AUTH_SELLPOST + 1);
define('AUTH_HIDE4POSTS', AUTH_SELLPOST + 2);
define('AUTH_HIDE4FORTUNE', AUTH_SELLPPOST + 3);
The principle is simple: don't make the two values of all the AUTH_ leading constants the same.

TimeVirus wrote: Just noticed the bug where if more than one post is sold in a thread multiple explain boxes show in posts below. I'm using phpBB 2.0.6

Well, that's weird. Please post two pieces of codes. One is the defining of the function assign_var in includes/template.php. The other is the last ten lines of the function get_hiding_info_box in includes/functions_hide.php.

User avatar
TimeVirus
Registered User
Posts: 125
Joined: Sat Jul 12, 2003 12:17 am

Post by TimeVirus » Thu Dec 11, 2003 5:53 pm

Oh I changed the code there in above example, it's not stock from your zip. (sorry not clearer, it was very late at night)

Ok the principle was clear, just not whether you meant to change all the auths to a real number. I was asking whether I only fix the "12" if it was needed or also add 13 after auth_hide4reply, etc.

In other words I was asking can I change:

Code: Select all

# The number 12 should equal to the max number of the existing AUTH_* plus 1 
# e.g. if you have Global Announcement installed, AUTH_GLOBALANNOUNCEMENT will 
# take the number 12. So you have to set AUTH_SELLPOST to 13 
define('AUTH_SELLPOST', 12); 
define('AUTH_HIDE4REPLY', AUTH_SELLPOST + 1); 
define('AUTH_HIDE4POSTS', AUTH_SELLPOST + 2); 
define('AUTH_HIDE4FORTUNE', AUTH_SELLPPOST + 3);
to:

Code: Select all

# The number 12 should equal to the max number of the existing AUTH_* plus 1 
# e.g. if you have Global Announcement installed, AUTH_GLOBALANNOUNCEMENT will 
# take the number 12. So you have to set AUTH_SELLPOST to 13 
define('AUTH_SELLPOST', 12); 
define('AUTH_HIDE4REPLY', 13); 
define('AUTH_HIDE4POSTS', 14); 
define('AUTH_HIDE4FORTUNE', 15);
I did and it seemed to work, but I didn't understand whether the instructions meant for me to.

I will post the code examples you requested as soon as I get a free moment to do so.
I'm probably wrong again...

Locked

Return to “[2.0.x] MODs in Development”