Phunky
Forum Replies Created
-
Forum: Plugins
In reply to: WP-OnlineCounterThere a few “Whos Online” Plugins kicking about, ive been meaning to make a more useable one for some time.
Forum: Plugins
In reply to: Adding a new MIME type via the $override Array?arrrr great stuff, thats just what i was looking for i assumed there would be a hook or filter for it 🙂 thanks
Forum: Plugins
In reply to: Conditionally hiding navigation links?Ive just checked over my post again, and it wont actual work as it would be checking against as serialized array string.
you would need to unserialize($userRole) and check against the role feild in the array
Forum: Plugins
In reply to: Do I need a plugin for displaying animated gifsYou can do this, but it depends on the server that your WordPress is installed on.
basicly the .gif format copyright was updated changing what was allowed to be done with the file format and in turn this ability had to be filtered out in new versions of apache.
But tbh, if its a thumbnail anyway it would be best practise to not have it animated as why would someone want to view the same image again just because it was larger?
Forum: Plugins
In reply to: Conditionally hiding navigation links?here’s a quick function i knocked up for you that should return true or false depending if $userRole matches $role that is set.
<?php
function pky_dirtyRoleCheck($id,$role='admin'){
global $wpdb ;
$userRole = $wpdb->get_var("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = '$id' AND meta_key='wp_capabilities'");
if($userRole==$role){
return true;
} else {
return false;
}
}
?>
So just set $id to the current user id and $role to the role you are trying to find!
this will only work on WP2.0 and up!
Please note ive not tested it 😀 just hacked it from my own personal userProfile plugin i use on my sites
Forum: Plugins
In reply to: Echo the role name of logged in userHi Rediect1, glad you got it sorted!
Im almost certain there is a built in function to get the user role but ive totaly forgot what it is.
Tbh i tend to re-create the get_currentuserinfo() function myself with one that gathers all the user detail including wp_usermeta and the user role.
Anyway im glad you got it to work 🙂
Forum: Plugins
In reply to: Echo the role name of logged in userThe function i wrote only returns the role value, so you would need to echo dirty_get_role(); for my one to print.
Try putting your widget_user_role() as the last widget on your sidebar, if it then displays all the other widgets you know there summat wrong with the widget_user_role() function its self.
Also if its working when not being used as a widget it would seem to suggest you have not written the function correctly, i belive theres a certain way you are supose to write you widgets.
But as i said before, ive not really bothered with widgets so cant really help much on that side of things!
Forum: Plugins
In reply to: Echo the role name of logged in userIm not too sure how to help you here, ive not really looked at widgets myself.
Do you get a error at all on the sidebar? or is it just a case of nothing else will display after the widget_user_role()prints out?
Sorry i should have also mentioned above that you would need to global $userdata if you hadnt already got hold of the userid.
Forum: Plugins
In reply to: Walkthrough: Add a field to the registration pageupdate_usermeta(ID,'META_NAME','META_VALUE');This is the function i use in all my custom signup forms to allow for extra feilds to be attached to users.
This add’s it to wp_usermeta table instead of wp_users, which i belive is the way WP wanted people to do it
Forum: Plugins
In reply to: update_user_option() Not quite working right.I basicly ended up writing my own function which would create a nice user object.
Also there is a sub-object within it with everything from wp_usermeta for that user.
Ive done it a few times over now :S i dont have the newest version of this at work, but if you want to have a look over the code email me on mark[at]phunky.co.uk and ill send you what ive done on my new project.
Forum: Plugins
In reply to: Echo the role name of logged in userNo doubt there is a better way then doing it like this but…
function dirty_get_role($id){
$role = explode('"',$wpdb->get_var("SELECT meta_value FROM wp_usermeta WHERE meta_key = 'wp_capabilities' and user_id = '$id'"));
return $role[1];
}
This is a VERY, dirty way of doing it!
Forum: Plugins
In reply to: Run WP in a flash movie?So you wish to take the WordPress output and place it into flash.
Sounds intresting, i dont think ive seen anything like this around and tbh i would be suprised if i did as it quite a strange request.
You would most likely be better looking at some Flash/Action Scripting sites about importing data via PHP/MySQL this can be done quite easily.
Im unsure but if Flash can parse RSS that could be another way to use the data from WordPress
Forum: Fixing WordPress
In reply to: Quote codesDont get what your wanting? are you wanting to display a random quote on your page? or a quote from a post??
Forum: Everything else WordPress
In reply to: Integreating WP into a tableOf course, you would need to create a theme for WordPress really – but you could just be dirty and stick it in there :S
Forum: Installing WordPress
In reply to: installing WP 2 on win XPQuick and Simple way is to use XAMPP