sghod1212
Forum Replies Created
-
https://www.dagondesign.com/articles/hide-admin-panel-from-subscribers-plugin-for-wordpress/
That’s exactly what I was looking for^
There are also some other options listed in this thread:
I don’t think that’s quite what I’m looking for. I just want to get the url and if it contains the string “wp-admin” and the current user is not one of the 3 that are trusted, then I want the page to redirect to the homepage. I know I can take care of this in less than 3 lines of code in an if statement, but I’m not sure where to put it.
Forum: Fixing WordPress
In reply to: next_posts_link() sometimes doesn’t work in IEApparently I had to change the number of posts per page in the reading settings in WordPress from 15 to 10. Hope this helps someone else ??
Forum: Fixing WordPress
In reply to: How to change user information?So I didn’t find a solution, but I did find a workaround. I ran str_replace(“\'”, “‘”, $description); before displaying the user’s description, and then I ran the same code again before displaying the description in an edit box. PHPMyAdmin still shows the backslashes, but the users will never know.
Forum: Fixing WordPress
In reply to: How to change user information?I’m thinking that the issue deals with escape sequences somewhere in php or wordpress. When an apostrophe is put in the database something puts a backslash in front of it because it thinks that an escape sequence is necessary for the apostrophe to show up, but since the escape sequence is unnecessary the backslash and the apostrophe actually show up on the page. The next time a backslash is updated the number of backslashes doubles because a backslash would be put in front of every backslash as an escape sequence. I’m not sure if this is the issue, but if it is I’m still not sure how to go about fixing it.
Forum: Fixing WordPress
In reply to: How to change user information?Sorry, the last post was the code I used to update the data – not retrieve it. To retrieve it I simply do this:
$the_user = get_query_var(‘username’);
$curauth = get_userdatabylogin($the_user);
echo $curauth->user_description;Forum: Fixing WordPress
In reply to: How to change user information?if ($_GET[‘update’] == true && $_POST[‘description’])
{
$description = $_POST[‘description’];
$wpdb->update( $wpdb->usermeta,
array( ‘meta_value’=>$description ),
array( ‘meta_key’=>’description’,
‘user_id’=>$curauth->ID ));
}Forum: Fixing WordPress
In reply to: How to change user information?Thank you very much! $wpdb->update() worked, but it led to another problem. Every apostrophe gets a backslash added to it, and every time a backslash updates the number of backslashes doubles. Example:
Initial value: “This isn’t working.”
1st update: “This isn\’t working.”
2nd update: “This isn\\’t working.”
3rd update: “This isn\\\\’t working.”
4th update: “This isn\\\\\\\\’t working.”
and so on…I would do stripslashes() but I’d like for users to be able to use slashes in their profiles.
Forum: Fixing WordPress
In reply to: using an extra parameter in an URLThank you very much! This helped out a lot, but I have one related question. How would I go about doing the same thing except with more variables? Taking Marco’s example:
“mypage/marco” should direct the user to marco’s main page
“mypage/marco/comments” should direct the user to marco’s comments page
“mypage/marco/friends” should direct the user to marco’s friends pageIf anyone can shed some light on this problem it would be much appreciated.
Forum: Fixing WordPress
In reply to: How do I create a /user/username/ permalink?Alright, I figured out how to change /author/ to /user/. I just had to change $author_base in /wp-includes/rewrite.php. Now I have one more question. How would I go about making links like:
mysite.com/user/sghod1212/comments
mysite.com/user/sghod1212/editetc. for various subpages in each user page? Also, how would I retrieve the data (comments, edit, etc.) from the URL?
Forum: Fixing WordPress
In reply to: How do I create a /user/username/ permalink?I guess I could use the author’s template, but is there any way to make the permalink for certain types of users specifically:
mysite.com/user/USERNAME
as opposed to:
mysite.com/author/USERNAME
I already have the author template setup and working for authors of my site, but I want to create a template for users of my site who aren’t authors – just regular subscribers who can comment on posts.