Dynamic Text Replacement

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}
  1. {if FALSE != ""} {if:elseif ""} {if:else} {/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 ""} Edit {if member_group == "1"}Delete{/if} {/if} Embed
    {if ""}
    Comments are editable for one week.
    {/if}
    Copy & paste the code below to embed this comment.
  2. {if FALSE != ""} {if:elseif ""} {if:else} {/if}

    Replacing text with a link in it seems to lose the link… any workaround?

    <h1>link</h1>

    becomes a nonclickable heading…

    {if ""} Edit {if member_group == "1"}Delete{/if} {/if} Embed
    {if ""}
    Comments are editable for one week.
    {/if}
    Copy & paste the code below to embed this comment.
  3. {if FALSE != ""} {if:elseif ""} {if:else} {/if}

    Have you tried the <h1>‘s on the outside of the <a>‘s?

    {if ""} Edit {if member_group == "1"}Delete{/if} {/if} Embed
    {if ""}
    Comments are editable for one week.
    {/if}
    Copy & paste the code below to embed this comment.
  4. {if FALSE != ""} {if:elseif ""} {if:else} {/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 ""} Edit {if member_group == "1"}Delete{/if} {/if} Embed
    {if ""}
    Comments are editable for one week.
    {/if}
    Copy & paste the code below to embed this comment.
  5. {if FALSE != ""} {if:elseif ""} {if:else} {/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 ""} Edit {if member_group == "1"}Delete{/if} {/if} Embed
    {if ""}
    Comments are editable for one week.
    {/if}
    Copy & paste the code below to embed this comment.
  6. {if FALSE != ""} {if:elseif ""} {if:else} {/if}

    I’ll try that, thanks! :-)

    Wonderful script, btw.

    {if ""} Edit {if member_group == "1"}Delete{/if} {/if} Embed
    {if ""}
    Comments are editable for one week.
    {/if}
    Copy & paste the code below to embed this comment.
  7. {if FALSE != ""} {if:elseif ""} {if:else} {/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 ""} Edit {if member_group == "1"}Delete{/if} {/if} Embed
    {if ""}
    Comments are editable for one week.
    {/if}
    Copy & paste the code below to embed this comment.
  8. {if FALSE != ""} {if:elseif ""} {if:else} {/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 ""} Edit {if member_group == "1"}Delete{/if} {/if} Embed
    {if ""}
    Comments are editable for one week.
    {/if}
    Copy & paste the code below to embed this comment.
  9. {if FALSE != ""} {if:elseif ""} {if:else} {/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 ""} Edit {if member_group == "1"}Delete{/if} {/if} Embed
    {if ""}
    Comments are editable for one week.
    {/if}
    Copy & paste the code below to embed this comment.
  10. {if FALSE != ""} {if:elseif ""} {if:else} {/if}

    Create a PHP file with one command that will tell you everything about the environment.

    <?
    info();
    ?>

    {if ""} Edit {if member_group == "1"}Delete{/if} {/if} Embed
    {if ""}
    Comments are editable for one week.