Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Header configuration & styling »

[SOLVED] CSS Calendar icon not displaying correctly since upgrade to 3.6.7


  #1  
Old May 18, 2011, 02:25 AM
GarethP
 
64 posts · Jun 2010
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?
  #2  
Old May 18, 2011, 06:38 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old May 18, 2011, 07:12 AM
GarethP
 
64 posts · Jun 2010
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...
  #4  
Old May 18, 2011, 09:50 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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)
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; May 18, 2011 at 10:00 AM.
  #5  
Old May 19, 2011, 01:30 AM
GarethP
 
64 posts · Jun 2010
Yay! works like a charm - the preg function do seem a little confusing! I guess the <return> character in the string throws them...

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar icon for date jpreuss Post-Kicker, -Byline & -Footer 7 Jun 9, 2011 09:05 AM
[SOLVED] Sub menu not displaying correctly quillik Atahualpa 3 Wordpress theme 11 Apr 1, 2011 12:38 PM
Site Not Displaying Correctly in Opera c12281 New Versions, & Updating 7 Nov 4, 2010 08:54 AM
[SOLVED] blog not displaying correctly in safari pltrace Header configuration & styling 3 Sep 28, 2009 02:41 PM
[SOLVED] Site not displaying correctly in IE martdris Atahualpa 3 Wordpress theme 2 Aug 4, 2009 07:36 AM


All times are GMT -6. The time now is 12:05 AM.


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