Welcome Guest, Not a member yet? Register   Sign In
sIFR helper
#1

[eluser]amrnt[/eluser]
Here's my sIFR helper.

1. Put "sifr_helper.php" in "helpers" folder.
2. sifr's Swf-fonts, sifr's css, and sifr's js, as a default i put it in "<?php echo base_url(); ?>/statics/sifr/".
- In your view put these lines.
Code:
<link rel="stylesheet" href="<?php echo base_url(); ?>statics/sifr/sIFR-screen.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php echo base_url(); ?>statics/sifr/sIFR-print.css" type="text/css" media="print" />
    
<script src="<?php echo base_url(); ?>statics/sifr/sifr.js" type="text/javascript"></script>
----------------
NOW, load your new helper by editing config/autoload.php
Code:
$autoload['helper'] = array('url', 'html', 'sifr');
OR by loading it in you controller
Code:
$this->load->helper('sifr');
----------------
Finally you're ready to use it !
just write this code in your view ...!
Code:
echo sifr_it('Test');
//and it returns a string which contain the header and the script with the default values

And also you can passing custom values by array
Code:
echo sifr_it('Test with costum', array("link"=>"http://www.google.com", "font"=>"font_name"));
//and it returns a string which contain the header and the script with your custom values
/*
HERE ARE THE DEFAULT VALUES, AND YOU CAN PASS NEW VALUE BY THE ARRAY:
    $swfpath = base_url().'statics/sifr/';//SWF-fonts path
    $id = '';//for custom id, [DON'T repeat it in the same page]
    $link = '';//link for heading
    $header = '1';//heading size 1,2,3,4,5,6
    $font = 'tradegothic';//font name
    $sColor = '#000000';//heading color
    $sLinkColor = 'null';//[if] link color
    $sHoverColor = 'null';//Hover color
    $sBgColor = 'null';//heading background color
    $nPaddingTop = '0';/PaddingTop
    $nPaddingRight = '0';//PaddingRight
    $nPaddingBottom = '0';//PaddingBottom
    $nPaddingLeft = '0';//PaddingLeft
    $textalign = '';//textalign {center, right, left}
    $offsetLeft = '';//offsetLeft=N Pushes text Npx to the right
    $offsetTop = '';/offsetTop=N Pushes text Npx down.
    $underline = '';//underline={true, false} Adds underline to links on hover
    $sCase = '';//Case {upper, lower}
    $sWmode = '';//sWmode {transparent, opaque} !!! unrecommended !!!
*/

Download HERE
[[FileConfusedIFR_helper0.1.zip]]

Enjoy ..
Amr Numan Tamimi - brainythink Smile
#2

[eluser]davidbehler[/eluser]
And what does this helper do?
I guess it got something to do with flash!?
#3

[eluser]amrnt[/eluser]
this helper is replace you headings with a flash that uses a custom font,
see this example http://www.mikeindustries.com/blog/files/sifr/2.0/

this is the site http://www.mikeindustries.com/blog/sifr/

and I made this helper specific for headings h1, h2, h3, h4, h5, h6.
#4

[eluser]Iverson[/eluser]
HUH? I went to the example page and it's just text in Firefox with javascript errors in Firebug. Tried it in IE and all I get is image placeholders. I'm still trying to grasp the concept of the helper....
#5

[eluser]amrnt[/eluser]
WUH? first {the sIFR is NOT mine.} and I tried it on FF 3.0 and IE 6 and it works fine with no one error.
and what helper's doing, is that you pass a text and it replace it with a flash contain that text with a custom font and here also a site for sIFR fonts http://www.fontsmack.com/
#6

[eluser]Iverson[/eluser]
[quote author="brainythink" date="1226956280"]WUH? first {the sIFR is NOT mine.} and I tried it on FF 3.0 and IE 6 and it works fine with no one error.
and what helper's doing, is that you pass a text and it replace it with a flash contain that text with a custom font and here also a site for sIFR fonts http://www.fontsmack.com/[/quote]

When I click "Remove sIFR headlines", I get "sIFR.rollback is not a function" in Firebug. When I click "no" or "yes", I get "sIFR.preferenceManager is undefined". The screenshot is from IE.
#7

[eluser]amrnt[/eluser]
see, this "Remove sIFR headlines"... its an addons. and i don't recommend it. and if there's any problem, i dont have any responsibility about it. I'm made this helper to ease usin sIFR.
the main idea and the core of using sIFR is about using a non-system font in your page.
Codeigniter use it in its main page .
#8

[eluser]Iverson[/eluser]
Yeah I just finished reading up on it. Love the idea.
#9

[eluser]amrnt[/eluser]
OOH, that's fine!
Thanks




Theme © iAndrew 2016 - Forum software by © MyBB