• Page 1 of 1
  • 1
Forum moderator: bigblog  
uCoz Community » For Webmasters » Design Customization » IF forum thread date (if)
IF forum thread date
Korijs
Posts: 267
Reputation: 5

Message # 1 | 10:09 AM
Hello. Is that possible to use forum new threads informer with IF codes for example:

IF thread DATE is TODAY - something.. ELSE something 2 .. ?!

ty.

edit: oh, WDAY, yes? smile

anyway the question for solution is active
Post edited by Korijs - Friday, 2014-09-26, 10:28 AM
Sunny
Posts: 9296
Reputation: 456

Message # 2 | 12:48 PM
Korijs, conditional operators can be used in the informers.
I'm not active on the forum anymore. Please contact other forum staff.
Korijs
Posts: 267
Reputation: 5

Message # 3 | 1:57 PM
But the main idea as problem is...

I created 2 CSS styles - for example red and green

I need informer which provide information about newest updated threads as default informer, BUT in informer i wanted to put some code that provide these 2 CSS styles in 2 groups - 1 CSS for forum threads updated today and 1 CSS for other..

what could be a code for this example?

IF threads are updated today = my style 1, if other days = my style 2

get idea?
Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 4 | 3:51 AM
Korijs, yes, $WDAY$ will work for that application assuming it is displayed as Today. Wherever you want to apply your class use the following condition. smile

Code
class="<?if($WDAY$ == 'Today')?>class1today<?else?>class2other<?endif?>"

Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
Korijs
Posts: 267
Reputation: 5

Message # 5 | 3:14 PM
hmm, maybe i'm too tired but i dont get it how can i make it working.

my example @informer design:

Code
<style>
   
  .forumreplies {
   
  background-color:#f0dddf;
border:1px solid #E7C39C;
border-radius:2px;
width:20px;
  }
   
</style>

<style>
   
  .forumrepliesm {
   
  background-color:#f0dddf;
border:1px solid #E7C39C;
border-radius:2px;
width:160px;
  }
   
</style>

<table style="padding: 2.5px 0pt;" width="100%" cellpadding="0" cellspacing="0">
<tbody><tr><td align="left"><img src="http://ucozwebmeistars.ucoz.lv/img/8.gif">  

<a href="$THREAD_URL$">$THREAD_TITLE$</a></td>

<td align="right"><span> <center>$REPLIES$</center> </div></span></td>
</tr></tbody></table>
Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 6 | 3:24 PM
Code
<style type="text/css">
.forumreplies {background-color:#f0dddf; border:1px solid #E7C39C; border-radius:2px; width:20px;}
.forumrepliesm {background-color:#f0dddf; border:1px solid #E7C39C; border-radius:2px; width:160px;}
</style>

<table class="<?if($WDAY$ == 'Today')?>forumreplies<?else?>forumrepliesm<?endif?>" style="padding: 2.5px 0pt;" width="100%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="text-align:left;">
<img src="http://ucozwebmeistars.ucoz.lv/img/8.gif">  <a href="$THREAD_URL$">$THREAD_TITLE$</a>
</td>
<td style="text-align:right;">
<div style="text-align:center;">$REPLIES$</div>
</td>
</tr>
</tbody>
</table>


Try that. smile

Unrelated developer perspective - why do you right align your text in your right hand side table cell to then center align the text? If you only need it center aligned good coding practices wouldn't require you to right align the text within the table cell. happy

Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
Korijs
Posts: 267
Reputation: 5

Message # 7 | 4:34 PM
ty for tryin but its doesnt work :/

all threads at the informer are showing the same color (yes, ichanged 1st css style color now)

result now with your code:



result what im waitin:



(red border means that this thread have been posted in forum today)

eh
Attachments: 2023802.png (7.3 Kb) · 4573497.png (10.8 Kb)
Post edited by Korijs - Monday, 2014-09-29, 4:35 PM
uCoz Community » For Webmasters » Design Customization » IF forum thread date (if)
  • Page 1 of 1
  • 1
Search: