latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

About: Patrix

Sorry, I've not written a description yet. I'll get to it soon!


My Latest Replies (From Various Topics)

Viewing 9 replies - 1 through 9 (of 9 total)
Author Replies
Author Replies
Posted: Tuesday Apr 16th, 2013 at 7:23 pm #47627
Patrix
Username: s.patrix

Hello,
Thanks for your response.

I read the Advanced Mod-Rewrite Linkage, but it is still unclear if I will be available to use the s2member-files directory.

Any chance you have any example or guide that I can follow in order to better understand how the advanced mod-rewrite works?

Thanks.

Posted: Thursday Jan 24th, 2013 at 9:13 am #39403
Patrix
Username: s.patrix

That’s great!
Thanks a lot! ;)

Posted: Thursday Jan 17th, 2013 at 1:21 pm #37904
Patrix
Username: s.patrix

Hi Bruce,
Thanks for your reply,
I was able to get it work.

I was just wondering if the code is clean, or if there is a better way to accomplish this:

<?php 
if(is_post_protected_by_s2member($id) )  : //check if post is protected
	
	$level_needed = (is_post_protected_by_s2member($id)); 

	if (in_array("0", $level_needed)) :
		// icon 1

	elseif (in_array("1", $level_needed)) :
		//icon 2

	endif;

else : //if post is not protected
	// icon 3
	
endif;
?>

Thanks! ;)

Posted: Tuesday Jan 15th, 2013 at 1:57 pm #37617
Patrix
Username: s.patrix

Hey Jason,

Well, it perfectly works now!! That’s exactly what I needed.

Now the Admin box, shows the name of my custom levels.

Thanks again for your help!!

Posted: Sunday Jan 13th, 2013 at 4:02 pm #37302
Patrix
Username: s.patrix

Thanks again for helping me on this.

I still have an issue, now I have duplicated levels (for the same level value), because this part of the code is still getting the dynamic levels.

for($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
													echo ($pages[$n] !== array("all")) ? /* Protecting `all` Pages, of any kind? */
													((!in_array("all-pages", $posts[$n])) /* Protecting Posts of type: `page` ( i.e. `all-pages` )? */
													? '<option value="'.$n.'"'.((in_array($page_id, $pages[$n])) ? ' selected="selected"' : '').'>'.(($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'Require Highest Level #'.$n : 'Require Level #'.$n.' ( or higher )').'</option>'."\n"/**/
													: '<option value="" disabled="disabled">Level #'.$n.' ( already protects "all" Posts of this type )</option>'."\n")/**/
													: '<option value="" disabled="disabled">Level #'.$n.' ( already protects "all" Pages )</option>'."\n";
												/**/

Any fix for this?

Thanks a lot! :)

Posted: Sunday Jan 13th, 2013 at 3:52 pm #37299
Patrix
Username: s.patrix

Well,
this works like a charm!!!

And it is much a better solution that what I was expected to complete by today.

Thanks again for your quick support, and for providing the solution. ;)

Posted: Sunday Jan 13th, 2013 at 2:14 pm #37287
Patrix
Username: s.patrix

Thanks again Jason,

I like the idea of the Javascript, but for now I have to go with the “dirty” solution… :) running out of time.

I tried to apply the code you wrote, but it seems not to work. When I create a post/page nothing changes.

Any idea why?

Thanks

Posted: Sunday Jan 13th, 2013 at 1:32 pm #37280
Patrix
Username: s.patrix

Hi again, and thanks for following up on this :)

Ok let me explain in more details:

Here’s the structure I have:

1: Free to eveyone, not registered on WP | Value=”” | Blank
2: Registered Users – default new users on WP | Value=”0″ | Level #0
3: Paid Registered Users – paid membership | Value=”1″ | Level #1

So, I can’t use any Tag/Category/Custom Capability restriction upfront, because otherwise he won’t be able to assign a new post the “Free without registration” or “lower” level.
– Some posts from the same category are

What I was thinking then, is to not block any tag/category and to tell the client to manually assign a level for each article.

And you may ask… so what? That’s the out of the box feature! :P

Well, the issue is because the client doesn’t want to switch the dropdown selection from BLANK to LEVEL 0 for every new post, but he would like to have LEVEL 0 as default for new posts, and in case select the BLANK or LEVEL 1.

Does it make sense?

Thanks.

Posted: Sunday Jan 13th, 2013 at 3:55 am #37223
Patrix
Username: s.patrix

Hi Jason,
Thank you for the response, and for your help.

Ok, no problem, I’m willing to save the file and re apply the changes when it’s time to update :)
I would really appreciate if you could help me figuring this out, (if it is not too complicated)

I changed the default line with:

echo '<option value="">Free to Everyone</option>'."\n"; /* By default, we allow public access to any Post/Page. */

and that’s the easy part…

But what about the dynamic levels? How can I get the names instead of the numbers?

Thanks again.

Viewing 9 replies - 1 through 9 (of 9 total)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.