PHP to VB3 Code

Discussion in 'Web Design & Coding' started by Electronic Punk, Jul 28, 2006.

  1. Electronic Punk

    Electronic Punk Administrator Staff Member Political User Folding Team

    Messages:
    18,590
    Location:
    Copenhagen, Denmark
    Mostly for my reference:

    template:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/URL]">
    <html>
    <head>
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <link rel="stylesheet" type="text/css" href="themes/orbitz/style.css" />
    </head>
    <body>
    <table valign="center" align="center" cellpadding="0" cellspacing="\$stylevar[maincellspacing]" width="100%">
     <tr>
      <td style="background: url('http://forum.osnn.net/orbitz/spread_thing_slice.gif')"><img src="[URL]http://forum.osnn.net/orbitz/spread_thing_slice.gif[/URL]" alt="" /></td>
      <td style="background: url('http://forum.osnn.net/orbitz/spread_thing_slice.gif')">
       <table align="left">
        <tr>
         <td width="200" align="left" valign="top"><img src="themes/orbitz/recenticon.gif" align="bottom" alt="" /> <b>Recent <a href="index.php" target="_top">News</a> Posts</b><hr align="left" style="width:\$stylevar[maintablewidth];color:\$stylevar[bordercolor];border:1px 0px 0px 0px;height:1px" />\$recentnewsposts</td>
         <td width="2">&nbsp;</td>
         <td width="200" align="left" valign="top"><img src="themes/orbitz/recenticon.gif" align="bottom" alt="" /> <b>Recent <a href="[URL]http://forum.osnn.net[/URL]" target="_top">Forum</a> Posts (<a href="[URL]http://forum.osnn.net/search.php?do=getnew[/URL]" target="_top">New</a>)</b><hr align="left" style="width:\$stylevar[maintablewidth];color:\$stylevar[bordercolor];border:1px 0px 0px 0px;height:1px" />\$recentforumposts</td>
        </tr>
       </table>
      </td>
     </tr>
    </table>
    </body>
    </html>
    PHP:
    unset($recentforumposts);
    $recentforumget 5// Number of posts to get
    $recentforumlength 25// Length of title to display before cutting off
    $forumexclude "17,34,22,25,26,27,28,29,40,53,55,57,59,64,65,71"// Add forum id's to exclude from get (eg private ones) sepetate by a comma
    $getposts query("SELECT threadid,title FROM thread WHERE (visible <> 0)".iif($forumexclude," AND (forumid NOT IN ($forumexclude))")." AND (open <> '10') ORDER BY lastpost DESC LIMIT $recentforumget");
    while (
    $post fetch_array($getposts)) {
    $post[short_title] = iif(strlen($post[title]) > $recentforumlength,substr($post[title],0,$recentforumlength)."...",$post[title]);
    $post[full_title] = $post[title];
    $recentforumposts .= "<a href=\"http://forum.osnn.net/showthread.php?goto=newpost&amp;t=$post[threadid]\" title=\"$post[full_title]\" target=\"_top\">$post[short_title]</a><br />\n";
    }
    unset(
    $recentnewsposts);
    $recentnewsget 5// Number of posts to get
    $recentnewslength 25// Length of title to display before cutting off
    $getnposts query("SELECT id,title FROM news_news WHERE (display <> 0) AND (program <> 1) ORDER BY time DESC LIMIT $recentnewsget");
    while (
    $npost fetch_array($getnposts)) {
    $npost[short_title] = iif(strlen($npost[title]) > $recentnewslength,substr($npost[title],0,$recentnewslength)."...",$npost[title]);
    $npost[full_title] = $npost[title];
    $recentnewsposts .= "<a href=\"http://www.osnn.net/comments.php?shownews=$npost[id]\" title=\"$npost[full_title]\" target=\"_top\">$npost[short_title]</a><br />\n";
    }
    Basically the hack I have in place to fix IE7 rendering issues in IE7 isn't working as well as I want, so am going to try and find a way to integrate the code into vb3 or pull the code out in some other way. Woo.
     
  2. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    Isn't just banning IE7 easier? :p

    Or at least using IE's conditional comment tags.
     
  3. madmatt

    madmatt Bow Down to the King Political User

    Messages:
    13,312
    Location:
    New York
    No.
     
  4. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    Lies! It is easier... it's just not preferable ;)
     
  5. kcnychief

    kcnychief █▄█ ▀█▄ █ Political User Folding Team

    Messages:
    16,948
    Location:
    Massachusetts
    We could ban Firefox like MS is doing with their new page re-design :p
     
  6. Khayman

    Khayman I'm sorry Hal... Political User Folding Team

    Messages:
    5,518
    Location:
    England
    easier just to ban all you lot
     
  7. Electronic Punk

    Electronic Punk Administrator Staff Member Political User Folding Team

    Messages:
    18,590
    Location:
    Copenhagen, Denmark
    Well Ie7 aside, getting it added would make these pages more efficient anyway, as it will be less code for users to download...

    Awaiting a response to a question as my code wasn't working correctly.