Top Poster
#1 ramon fincken 258
#2 Site admin 3
#3 Ber|Art 2
#4 braddmark 1
#5 accentmedia 1
#6 Xarzu 1
#7 Jan 0
#8 roger beckers 0
#9 Christine 0
#10 nextstep 0

The time now is Fri Sep 10, 2010 9:56 pm
Ramonfincken.com Forum Index
View unanswered posts
[solution][ubuntu] How to get the buttons at the right place?
Author ramon fincken :: Posted: Thu Sep 09, 2010 7:27 pm :: Category: Lounge


This is one of the things I am not so fond of ..

so here is the cure!

Open a command box and enter this:
Code:
gconftool-2 --set /apps/metacity/general/button_layout --type string menu:minimize,maximize,close


[solution] How to commit using tortoise svn with a different username?
Author ramon fincken :: Posted: Sat Aug 28, 2010 1:59 pm :: Category: Other projects


Well ... the solution can be found over here:

http://johnnycoder.com/blog/2008/07/31/...ntication/

I needed this when commiting a plugin for a client under his name at WordPress.org > http://wordpress.org/extend/plugins/gtm...rformance/


What is a content delivery network (CDN) ?
Author ramon fincken :: Posted: Tue Aug 03, 2010 9:14 pm :: Category: Other projects


Righty ..

I've got some more on a trending topic (which I make use of myself at http://www.creativepulses.nl ).
This is great stuff to speed up your site !

http://www.content-delivery-network-webhosting.com
http://www.what-is-a-content-delivery-network.com
http://www.what-is-a-cdn.com
http://www.wp-cdn.com
http://www.wp-content-delivery-network.com

More content will be added within 2 weeks Smile Probably sooner.


Need a Tekstschrijver OR copywriter ?
Author ramon fincken :: Posted: Mon Jun 07, 2010 7:46 pm :: Category: Other projects


Ow yes, I ve launched the following websites yesterday:
http://www.tekstschrijver-huren.nl
and
http://www.copywriter-huren.nl

and allready I have two copywriters who published their info for free Smile

Join them! http://www.tekstschrijver-huren.nl/inschrijven/


[wordpress][solution] Use Gravityforms to add pages instead of posts
Author ramon fincken :: Posted: Sat Jun 05, 2010 3:29 pm :: Category: CMS-ses (Joomla, WordPress, etc..)


As you all know I love GravityForms to make dynamic contactforms.
http://www.gravityforms.com/ > Direct download



You can also use GravityForms to add posts, but today I needed to add pages.

Using this simple code ( http://www.ramonfincken.com/permalink/topic184.html ) I found out that /gravityforms/forms_model.php contained the call to wp_insert_post

Warnings:
* this will ALWAYS add a page instead of a post when using the post fields in the form configuration.
* you can still use categories, and tags, however you will need to have some PHP skills to show them on your site


Now it was easy:
Code:
FIND
$post_id = wp_insert_post($post_data);

BEFORE, ADD
            // Ramon Fincken's  hack to add a page instead of a post http://www.ramonfincken.com/permalink/topic217.html
            $post_data['post_type'] = 'page';




http://www.gravityforms.com/ > Direct download


[wordpress][solution] How do I assign a specific body ID tag to each page
Author ramon fincken :: Posted: Mon May 24, 2010 4:00 pm :: Category: CMS-ses (Joomla, WordPress, etc..)


Nick Field ( http://ca.linkedin.com/pub/nick-field/a/219/814 ) asked this question on LinkedIn:
How do I assign a specific body ID tag to each page
http://www.linkedin.com/groupAnswers?vi...=view_disc


My answer:

Solution how to add a unique ID to your posts or pages:
http://www.ramonfincken.com/uploads/topic216.txt


[solution][snipplet] function update_twitter_status() using the API
Author ramon fincken :: Posted: Mon May 24, 2010 11:59 am :: Category: PHP coding


A simple function to update your twitter status using the API:

Thanks to http://woork.blogspot.com/2007/10/twitt...-page.html


Code:

/**
* A simple function using Curl to post (GET) to Twitter
* Kosso : March 14 2007 http://woork.blogspot.com/2007/10/twitter-send-message-from-php-page.html
* Ramon Fincken http://www.ramonfincken.com/permalink/topic215.html
* Warning: make sure your message is not more then 140 chars!
*/
function update_twitter_status($username,$password,$message,$mailto = NULL){

   $message = substr($message, 0, 140);
   $host = "http://twitter.com/statuses/update.xml?status=".urlencode(stripslashes(urldecode($message)));

   $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, $host);
   curl_setopt($ch, CURLOPT_VERBOSE, 1);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
   curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
   curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
   curl_setopt($ch, CURLOPT_POST, 1);

   $result = curl_exec($ch);
    // Look at the returned header
   $resultArray = curl_getinfo($ch);

   curl_close($ch);

   if($resultArray['http_code'] == "200"){
         $twitter_status='Your message has been sended! <a>See your profile</a> http://twitter.com/' . $username;
   } else {
      $twitter_status="Error posting to Twitter. Retry";
   }
   if(isset($mailto))
   {
      mail($mailto, 'twitter sent', $twitter_status);
   }
   return $twitter_status;
}


[solution][snipplet] function has_gravatar()
Author ramon fincken :: Posted: Sun May 23, 2010 4:32 pm :: Category: PHP coding


Looking for an elegant method to see if a user has a gravatar or not ..

I stumbled upon this url: http://codex.wordpress.org/Using_Gravat...a_Gravatar
>
Quote:
The trick to do this is to specify "404" as the default. In this case, the gravatar service will return a 404 error if no gravatar exists, instead of returning some default image. A real image will get a 200 code. It is best to check for 200, as some other errors might be returned as well, for other cases.


Code:

function validate_gravatar($email) {
 // Craft a potential url and test its headers
  $hash = md5($email);
 $uri = 'http://www.gravatar.com/avatar/' . $hash . '?d=404';
   $headers = @get_headers($uri);
   if (!preg_match("|200|", $headers[0])) {
    $has_valid_avatar = FALSE;
   } else {
     $has_valid_avatar = TRUE;
 }
  return $has_valid_avatar;
}



Works great, alltough I would have named the function has_gravatar($email); or user_has_gravatar($email);

So this is the code I use at http://www.ikzoekeensportpartner.nl :
Warning: you cannot simply copy paste this code below, but if you are a PHP coder, you'll know what to do Smile
Code:

 /**
   * Checks if user has a gravatar or not
   * @return boolean
   */
  function has_valid_gravatar($email) {
      // Craft a potential url and test its headers
     $hash = md5($email);
    $uri = 'http://www.gravatar.com/avatar/' . $hash . '?d=404';
      $headers = @ get_headers($uri);
     if (!preg_match("|200|", $headers[0])) {
       $has_valid_avatar = FALSE;
      } else {
        $has_valid_avatar = TRUE;
    }
     return $has_valid_avatar;
 }

 /**
   * Returns gravatar OR default avatar url (if no gravatar found)
   */
  function create_gravatar_url($email, $size) {
    $rating = 'R';
    global $default_gravatar;
    if (validate :: email($email)) {
       if (overall :: has_valid_gravatar($email)) {
          return $url = "http://www.gravatar.com/avatar/" . md5($email) . "?r=" . $rating . "&amp;default=" . $default_gravatar . "&amp;size=" . $size;
        }
     }
     return $default_gravatar;
 }


All times are GMT
Who is Online
Who is Online Our users have posted a total of 259 articles
We have 12 registered users
The newest registered user is accentmedia
In total there are 7 users online :: 0 Registered, 0 Hidden and 7 Guests   [ Administrator ]   [ Moderator ]
Most users ever online was 40 on Tue Jan 05, 2010 11:59 pm
Registered Users: None
This data is based on users active over the past five minutes
Log in
Username:    Password:      Log me on automatically each visit    

New posts New posts    No new posts No new posts    Forum is locked Forum is locked
General forums
The world of freelance
Programming
Other projects
Poll
I love gifts

Yes goodies and presents! [2]
No but I love polls ! [0]

Related google ads
Where am I?
Hit me!