The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled PHP Code
Posted by: ur | September 28, 2010 @ 3:26am
PHP Code
[
Download
]
<?php $difference = date('N') - 1; $from = gmmktime(0, 0, 0, date('m'), date('d') - $difference, date('Y')) - date('Z'); $to = $from + 86400; $id = $modx->db->getValue("SELECT id FROM site_content WHERE pub_date>=$from AND pub_date <=$to "); function make_list($value){ $value = str_replace('#','<br />',$value); $exp = explode(';',$value); foreach($exp as $e){ if(trim($e)){ echo '<li><div>'.$e.'</div><br /></li>'; }} } if($id){ $menu_query = $modx->db->query("SELECT tmplvarid,value FROM site_tmplvar_contentvalues WHERE contentid=$id AND tmplvarid!=8 ORDER BY tmplvarid"); $menu_result = $modx->db->makeArray( $menu_query ); echo '<table border="1"><tr>'; $i=0; foreach($menu_result as $mr){ $i++; if($i%2) echo '<td valign="top" style="background: #CCC;">'; else echo '<td valign="top">'; echo '<center><b>'; switch($mr['tmplvarid']){ case 3: echo 'Ponedeljek'; break; case 4: echo 'Torek'; break; case 5: echo 'Sreda'; break; case 6: echo '�etrtek'; break; case 7: echo 'Petek'; break;} echo '</b></center>'; echo '<ul>'; make_list($mr['value']); echo '</ul>'; echo '</td>'; } echo '</tr></table>'; } ?>
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.53 / 8
53 Votes
http://codebin.yi.org/864
page generated in 0.01 seconds