Dynamic Text Replacement
by {embed="embeds/article-authors" entry_author=" Stewart Rosenberger" entry_username="stewartrosenberger" entry_id="14795"}
{if segment_2 != "embed-comments"}
{if logged_in_member_group == "1"} {if:else} {/if}
by {embed="embeds/article-authors" entry_author=" Stewart Rosenberger" entry_username="stewartrosenberger" entry_id="14795"}
280 Reader Comment{if "280" > 1}s{/if}
Back to the {if "articles" == "columns"}Column{if:elseif "articles" == "blog"}Post{if:else}Article{/if}{if "http://www.achinghead.com"} waylman {if:elseif twitter} waylman {if:else} waylman {/if}
Very interesting solution. However, if I understand things right you have to edit a php file to change the color and a js file to change the font (or is it the php file for both?). Not exactley convienient. What happens when you want an alternate stylesheet with different colors and/or fonts? While this method may work great for some, I just don’t see it working for everyone. Now, if there was a way to define the color, font, textsize, etc in the css and use that data to create the images I could see this as a more usefull solution.
{if ""} ceejayoz {if:elseif twitter} ceejayoz {if:else} ceejayoz {/if}
Replacing text with a link in it seems to lose the link… any workaround?
<h1>link</h1>
becomes a nonclickable heading…
{if ""} matt {if:elseif twitter} matt {if:else} matt {/if}
Have you tried the <h1>‘s on the outside of the <a>‘s?
{if ""} Roel Van Gils {if:elseif twitter} Roel Van Gils {if:else} Roel Van Gils {/if}
Chris: it is true that modern browsers like Opera allow you to scale everything on a webpage, including the images. Hoewever, if you’re visually impaired (like me), it’s not nice to read titles that look like ugly pixelated bitmaps when they’re enlarged.
If you would use vector titles (Flash or SVG), then the enlarged titles would still look crisp and be a lot easier on the eyes. Opera does a very good job on enlarging pages that consists of plain HTM text and Flash applets (don’t know about SVG), but bitmaps will be bitmaps…
btw: enlarging an image is also possible in Firefox. The Mouse Gestures extension has a very intuitive and elegant way tot do that and I use it a lot when I need to read small bitmap print on webpages. To read the small vector fonts in Flash applets, I usually just use the ‘Zoom in’ function on the context menu of a Flash movie.
{if "http://www.stewartspeak.com"} Stewart Rosenberger {if:elseif twitter} Stewart Rosenberger {if:else} Stewart Rosenberger {/if}
waylman: Both the font and the colors are stored in the PHP file, which generates the images. Although it would be nice to store this image in a CSS file, and dynamically apply it, it would require a lot more Javascript to do so, and the JS file here is already 8k in size. Either way, it’s still better than specifying your font/colors in Photoshop.
ceejayoz: You can make linked-headings work by replacing the link tag, not the heading. If you replace the heading, the link will be wiped out.
{if ""} ceejayoz {if:elseif twitter} ceejayoz {if:else} ceejayoz {/if}
I’ll try that, thanks! :-)
Wonderful script, btw.
{if "http://www.whole-studios.com"} Ryan Schroeder {if:elseif twitter} Ryan Schroeder {if:else} Ryan Schroeder {/if}
I was under the impression that PNGs aren’t properly supported by certain browsers…
Is there a particular reason you don’t use GIFs?
{if ""} Peter Zsodlos {if:elseif twitter} Peter Zsodlos {if:else} Peter Zsodlos {/if}
Haven’t tested it yet, but this is how I would go about doing it:
Modify the image generating script to take its parameters from the $_GET array. In the php script specify some defaults, and update the appropriate properties supplied to the script.
In javascript create an additional function (get_font_style(selector)), which would determine the style information for the text which is to be replaced.
Then just sit back, and call
replaceSelector(selector,get_font_style(selector),true);
{if ""} Peter Zsoldos {if:elseif twitter} Peter Zsoldos {if:else} Peter Zsoldos {/if}
correctly spelled is: Peter Zsoldos. I think I just my rights to make fun out of all my non-HUngarian friends who can’t spell it. ouch.
{if "http://english.info.org.il"} Hanan Cohen {if:elseif twitter} Hanan Cohen {if:else} Hanan Cohen {/if}
Create a PHP file with one command that will tell you everything about the environment.
<?
info();
?>