Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   [SOLVED] CSS Calendar icon not displaying correctly since upgrade to 3.6.7 (http://forum.bytesforall.com/showthread.php?t=14205)

GarethP May 18, 2011 02:25 AM

[SOLVED] CSS Calendar icon not displaying correctly since upgrade to 3.6.7
 
WordPress V3.1.2

I was using the Calendar Icon from here when I was running ATA 3.6.4

http://forum.bytesforall.com/showthread.php?t=12627

I have upgraded to 3.6.7 and this has stopped working now that PHP is banned from within the theme options. OK I thought, but %date% is given as a post info item so I updated the bits in the kickers to the following

Code:

<div class="date">
    <div class="date-inside">
        <div class="date-month">%date('M')%</div>
        <div class="date-day">%date('j')%</div>
        <div class="date-year">%date('Y')%</div>
    </div>
</div>

But, this is only returning the %date('M')% for all the parts - see here

http://www.nottshockey.org.uk/news/

Looking at the source I can see this

Code:

<div class="post-kicker">
    <div class="date">
        <div class="date-inside">
            <div class="date-month">May</div>
            <div class="date-day">May</div>
            <div class="date-year">May</div>
        </div>
    </div>
</div>

Have I missed something blatantly obvious? Can I only use one %date% per section?

juggledad May 18, 2011 06:38 AM

I think I know what is happening, the code is replacing all occurrences of '%date...%' with the value in the first '%date...%'.

I think this can be fixed but it may take a couple days since I have some paying work to do.

GarethP May 18, 2011 07:12 AM

Thanks Juggledad - for what it's worth I think you are right.

I think I found the right bit in bfa_popstinfo.php

starts at Ln183 in V3.5.7

Code:

        // Date & Time
        if ( strpos($postinfo_string,'%date(') !== FALSE ) {
                while ( strpos($postinfo,'%date(') !== FALSE ) {
                        $date_param = preg_match("/(.*)\%date\('(.*?)'\)(.*)/i",$postinfo,$date_matches);
                        ob_start();
                                the_time($date_matches[2]);
                                $date = ob_get_contents();
                        ob_end_clean();
                        $postinfo = preg_replace("/(.*)%date\((.*?)\)%(.*)/i", "\${1}" .
                $date. "\${3}", $postinfo);
                }
        }

I think I know what needs to be done in my head, but can't put it down on paper. I think it needs to scan through the contents of the box and replace the first occurrence of %date...% and then repeat the whole process again but starting where the first replace finished...

juggledad May 18, 2011 09:50 AM

Try this, change
HTML Code:

<div class="date">
    <div class="date-inside">
        <div class="date-month">%date('M')%</div>
        <div class="date-day">%date('j')%</div>
        <div class="date-year">%date('Y')%</div>
    </div>
</div>

to be all one line like this
HTML Code:

<div class="date"><div class="date-inside"><div class="date-month">%date('M')%</div><div class="date-day">%date('j')%</div><div class="date-year">%date('Y')%</div></div></div>
Looks like you have to have it all on one line, the preg-match likes it that way. I'm sure there is a way around it, but the preg functions make my head hurt (grin)

GarethP May 19, 2011 01:30 AM

Yay! works like a charm - the preg function do seem a little confusing! I guess the <return> character in the string throws them...


All times are GMT -6. The time now is 02:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.