• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

So - Fr Link 1, Sa Link 2??

Hangasilly

Neues Mitglied
Hiho Coderfreunde ;)

Ich kenne mich zwar weitgehend aus, aber jetzt bin ich auf ein Problem gestoßen, dass ich einfach nicht zu lösen weiß:

Ich brauche einen HTML - oder in HTML einzubettenden - Code, der da sagt, dass ein Link von Sonntag bis Freitag ein bestimmtes Ziel hat, allerdings soll er Samstags von 9.00h - 23.00h zu einer anderen Seite führen.

Warum in HTML?
Ich arbeite mit einem WBB-Forum, und der betreffende Link ist ein Link in dessen Navigation zu einer externen Seite. Das Linkziel ist im header.tpl festgelegt und eben dieses ist geschrieben mit HTML.

Ich hoffe mal, ich konnte mein Problem weitgehend schildern ;)

zum Guten schluss noch betreffender Link:
Code:
<tr> 
        <td style="width:120px; height: 30px;" valign="middle"> <table border="0" cellspacing="0" cellpadding="0" style="width: 100%; height: 100%;">
            <tr> 
              <td style="width: 70%;" align="center"><span class="normalfont"><a target="_blank" href="[I]http://der-derzeitige-Link.de[/I]"><img src="{$style['imagefolder']}/Radio1.gif" border="0" alt="Zum Radio" title="Radio" /></a></span></td>
            </tr>
          </table></td>
      </tr>
Freue mich über jede hilfe^^
 
das ist kein html sondern ein php template, achte auf das $style:

könnte also ca so klappen.

PHP:
$datum = getdate(time());
$link = 'http://der-derzeitige-Link.de';
if($datum['weekday'] == 'Sturday')
{
    if($datum['hours'] >= 9 and ($datum['hours'] <= 23))
    {
        $link = 'http://der_neue_link.de';
    }
}

?>
<tr> 
    <td style="width:120px; height: 30px;" valign="middle"> <table border="0" cellspacing="0" cellpadding="0" style="width: 100%; height: 100%;">
   <tr> 
    <td style="width: 70%;" align="center"><span class="normalfont"><a target="_blank" href="{$link}"><img src="{$style['imagefolder']}/Radio1.gif" border="0" alt="Zum Radio" title="Radio" /></a></span></td>
   </tr>
   </table></td>
</tr>
ungetestet !!
 
super danke - werds mal ausprobieren und dann informieren, obs geht^^ .. aber besten dank schonmal für deine mühe

edit:

Also bekomme dann folgenden Fehler, wenn ich das einbinde
(allerdings Testforum, daher leicht anderer Linkaufbau [wegen style - hier im Standartstyle nun]):

Fehler:
Code:
[B]Parse error[/B]:  syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in [B]/var/www/web136/html/Forum/Testforum/wbb2/global.php(218) : eval()'d code[/B] on line [B]23[/B]


Kompletter header.tpl, so wie ichs eingebunden hab:
(Links zum Testen sollen sich von index.php auf hmportal.php ändern)
Code:
<table style="width:{$style['tableoutwidth']}" cellpadding="{$style['tableoutcellpadding']}" cellspacing="{$style['tableoutcellspacing']}" align="center" border="{$style['tableoutborder']}" class="tableoutborder">
 <tr>
  <td class="mainpage" align="center">
   <table style="width:100%" border="0" cellspacing="0" cellpadding="0">
    <tr> 
     <td class="logobackground" align="center"><if($style['logoimage']!="")><then><a href="index.php{$SID_ARG_1ST}"><img src="{$style['logoimage']}" border="0" alt="$master_board_name" title="$master_board_name" /></a></then></if></td>
    </tr>
    <tr>
     <td align="center"><span class="smallfont"><if($wbbuserdata['userid'])><then><a href="usercp.php{$SID_ARG_1ST}"><img src="{$style['imagefolder']}/top_usercp.gif" border="0" alt="{$lang->items['LANG_GLOBAL_USERCP']}" title="{$lang->items['LANG_GLOBAL_USERCP']}" /></a>
     <a href="pms.php{$SID_ARG_1ST}"><img src="{$style['imagefolder']}/top_pms.gif" border="0" alt="{$lang->items['LANG_GLOBAL_PMS']}" title="{$lang->items['LANG_GLOBAL_PMS']}" /></a></then>
     <else><a href="register.php{$SID_ARG_1ST}"><img src="{$style['imagefolder']}/top_register.gif" border="0" alt="{$lang->items['LANG_GLOBAL_REGISTER']}" title="{$lang->items['LANG_GLOBAL_REGISTER']}" /></a></else></if>
     <a href="calendar.php{$SID_ARG_1ST}"><img src="{$style['imagefolder']}/top_calendar.gif" border="0" alt="{$lang->items['LANG_GLOBAL_CALENDAR']}" title="{$lang->items['LANG_GLOBAL_CALENDAR']}" /></a>
     <a href="memberslist.php{$SID_ARG_1ST}"><img src="{$style['imagefolder']}/top_members.gif" border="0" alt="{$lang->items['LANG_GLOBAL_MEMBERSLIST']}" title="{$lang->items['LANG_GLOBAL_MEMBERSLIST']}" /></a>
     <a href="team.php{$SID_ARG_1ST}"><img src="{$style['imagefolder']}/top_team.gif" border="0" alt="{$lang->items['LANG_GLOBAL_TEAM']}" title="{$lang->items['LANG_GLOBAL_TEAM']}" /></a>
     <a href="search.php{$SID_ARG_1ST}"><img src="{$style['imagefolder']}/top_search.gif" border="0" alt="{$lang->items['LANG_GLOBAL_SEARCH']}" title="{$lang->items['LANG_GLOBAL_SEARCH']}" /></a>
     <a href="misc.php?action=faq{$SID_ARG_2ND}"><img src="{$style['imagefolder']}/top_faq.gif" border="0" alt="{$lang->items['LANG_GLOBAL_FAQ']}" title="{$lang->items['LANG_GLOBAL_FAQ']}" /></a>
     <if($wbbuserdata['a_can_use_acp']==1 && $wbbuserdata['a_acp_or_mcp']==1)><then><a href="acp/index.php" target="_blank"><img src="{$style['imagefolder']}/top_acp.gif" border="0" alt="{$lang->items['LANG_GLOBAL_ACP']}" title="{$lang->items['LANG_GLOBAL_ACP']}" /></a></then></if>
     <if($wbbuserdata['a_can_use_acp']==1 && $wbbuserdata['a_acp_or_mcp']==0)><then><a href="acp/index.php" target="_blank"><img src="{$style['imagefolder']}/top_modcp.gif" border="0" alt="{$lang->items['LANG_GLOBAL_MODCP']}" title="{$lang->items['LANG_GLOBAL_MODCP']}" /></a></then></if>

<?php    
$datum = getdate(time());
$link = 'index.php';
if($datum['weekday'] == 'Saturday')
{
    if($datum['hours'] >= 9 and ($datum['hours'] <= 23))
    {
        $link = 'hmportal.php';
    }
}

?>

 <a href="index.php"><img src="{$style['imagefolder']}/top_start.gif" border="0" alt="{$lang->items['LANG_GLOBAL_TOINDEX']}" title="{$lang->items['LANG_GLOBAL_TOINDEX']}" /></a></span></td>
    </tr> 

<table colspan="10" align="center"><span class="smallfont">
<if($stylescount!=1)><then><br><select onchange="window.location=('index.php?action=style&amp;styleid='+this.options[this.selectedIndex].value)+'{$SID_ARG_2ND}'" name="styleid">
  <option value="0" selected="selected">{$lang->items['LANG_PERS_STYLEWAHL']}</option>
  <option value="0">--------------------</option>
  $stylesname
  </select><br /></then></if><br>

   </table><br />
 
Zurück
Oben