English flagItalian flagKorean flagChinese (Simplified) flagChinese (Traditional) flagPortuguese flagGerman flagFrench flagSpanish flagJapanese flagArabic flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroatian flagDanish flagFinnish flagHindi flagPolish flagRomanian flagSwedish flagNorwegian flagCatalan flagFilipino flagHebrew flagIndonesian flagLatvian flagLithuanian flagSerbian flagSlovak flagSlovenian flagUkrainian flagVietnamese flagAlbanian flagEstonian flagGalician flagMaltese flagThai flagTurkish flagHungarian flagBelarus flagIrish flagIcelandic flagMacedonian flagMalay flagPersian flag

Category: Web Design Tips


Okay, we all remember is_supporter, but things aren’t that easy with pro -sites anymore… I have been reading all over the web people trying to get info on these. They want to do things like wrap a admin menu in a check so that if there not a premium user, the menu isnt shown. They want to display a custom nag to non-paid up users.. So after alot of googling and a jackpot in the code, Here are the functions and parameters. THanks to well documented code..

 

/**
* Check if a given site is Pro or at a given Pro level
*
* @since 3.0
*
* @param int $blog_id optional – The ID of the site to check. Defaults to current blog.
* @param int $level optional – Check if site is at this level or below. If ommited checks if at any level.
* @return bool
*/
function is_pro_site($blog_id = false, $level = false) {
global $psts;
return $psts->is_pro_site($blog_id, $level);
}

/**
* Check if a given user is a member of a Pro site (at any level)
*
* @since 3.0
*
* @param int $user_id optional – The ID of the user to check. Defaults to current user.
* @return bool
*/
function is_pro_user($user_id = false) {
global $psts;
return $psts->is_pro_user($user_id);
}

/**
* Check if a given site is in an active trial
*
* @since 3.0
*
* @param int $blog_id required – The ID of the site to check.
* @return bool
*/
function is_pro_trial($blog_id) {
global $psts;
return $psts->is_trial( $blog_id );
}

/*
* function psts_levels_select
* Print an html select field to choose level for an external plugin
*
* @param string $name Name of the form field
* @param int $selected the level number to select by default
*
* @return echo html select
*/
function psts_levels_select($name, $selected) {
global $psts;
$psts->levels_select($name, $selected);
}

//depreciated!
function is_supporter($blog_id = false) {
return is_pro_site( $blog_id, apply_filters( ‘psts_supporter_level’, false ) );
}

//depreciated!
function is_supporter_user($user_id = ”) {
return is_pro_user( $user_id );
}

//depreciated!
function supporter_feature_notice() {
global $psts;
$psts->feature_notice();
}

//depreciated!
function supporter_get_expire($blog_id = false) {
global $psts;
return $psts->get_expire($blog_id);
}

 

So I noticed that when embedding an Iframe, Google Chrome (and Safari) failed to respond to scrolling=no.

I went to look and see if this syntax was deprecated, but its not.

Basically webkit (safari and chrome are based on them) values css styles on the html, body, and others, higher than the actual iframe style itself.

what that means is that if their is an ‘overflow’ attribute as anything other than ‘hidden’ in your applicable css, and you place scrolling=no onto an iframe style or place it in the html itself, chrome and safari will show scroll bars. firefox and IE will not. WTF?

What can you do..

Well you can place the iframe inside a div, call larger than width and heights to eleminate the ‘auto’ scroll bars in chrome and safari, then use a div outside of it with a set height and width as well as overflow=hidden to trim the iframe.

The Cause…

There is an attribute inside your css that calls overflow: scroll, or overflow: auto, or overflow-x: scroll, or overflow-y: scroll, or auto or whatever… If you are lucky enough to be able to pull this css style attribute out, it will fix your problem…

 

Sometimes it is difficult to locate your server path.

Drop this string into a .php file called ‘locate-path’ or something, and then navigate to it in a browser to see your full server path!

{code type=php}
<p><?php echo $_SERVER[‘PATH_TRANSLATED’];?></p>
{/code}
 

I know that if any of you have used iframes you’ll have noticed the white box that floats there so in-your-face, just taunting you with its uglyness as the rest of the page loads.

Why not take a screenshot of the page when it has fully loaded, crop the img down to just the contents of the fully loaded frame, and then use it as the background for a div container around the frame. an example would be:

{code type=php}
<div style=”background: url(‘http://erikshosting.com/childframe/pre-load-screenshot.png’);”>
<iframe src=”http://erikshosting.com/childframe/frame1.php” width=”100%” height=”211″ frameborder=”0″ scrolling=”no” overflow=”hidden” name=”erocks-global-nav-embed”>
You Must Use A Browser Built This Century To See This Frame</iframe></div>
{/code}
 

So, I was working with the login-with-ajax wordpress plugin, When I noticed that it displays differently in chrome. I was blown away that firefox and internet explorer would both show the appropriate  css styling and that chrome should some entirely different placing of the div via css.

So what I needed was a way to have two different style classes for each browser set..

So I did some research and found that we can use the webkit difference of chrome and safari to firefox and IE. So, if you want a chrome/safari specific css style override just frame it in the below code, and drop it in below the old line# in your stylesheet.

{code type=css}
#div1 {old rules for:IE,Firefox;}
@media screen and (-webkit-min-device-pixel-ratio:0) {
#div1 {new rules for:Chrome,Safari;}
}
{/code}