ThWboard Support-Forum (Archiv)

Ort: / Boardübersicht / Code Hack Requests / threadviews für die news im portal @ Curson


Seite 1 von 1

Sh4d0w schrieb am 26.02.2003 um 21:37 Uhr

ich wusste nich, wo ichs reinpackn sollte... da ich Curson's portal-thread damit nich unnötig verlängern wollte, hab ichs hier reingehaun!

es geht um die news im portal. ich hatte das schon vorgeschlagn, curson meinte aber es wär nich nötig. naja, da ich mich mit php nich wirklich auskenn... frag ich die hacker hier einfach ma.

der code für die portalnews sieht ja folgendermaßn aus:

/////////////////////
//news
/////////////////////
if (stristr( $PHP_SELF, 'portal.php' ) && $html == NULL)
{
$news = NULL;

if ($begin==NULL)
{
     $begin=0;
}

$r_thread = thwb_query("SELECT threadid, threadtopic, threadauthor,
        threadreplies, threadcreationtime FROM ".$pref."thread WHERE
        boardid='".$portalconfig['newsforumid']."'
        ORDER BY threadcreationtime DESC LIMIT $begin,$portalconfig[newsperpage]");

while( $portal_thread = mysql_fetch_array($r_thread) )
{

        $portal_thread['threadauthor'] = parse_code($portal_thread['threadauthor']);
        $portal_thread['threadtopic'] = parse_code($portal_thread['threadtopic']);
        $portal_thread['threadcreationtime'] = form_date($portal_thread['threadcreationtime']);

        $r_post = thwb_query("SELECT posttext FROM ".$pref."post WHERE threadid='".$portal_thread[threadid]."' ORDER BY posttime ASC");
        $post = mysql_fetch_array($r_post);
        $post['posttext'] = parse_code($post['posttext'], 1, 1 , 1, 1);


    $news = "
    <table width='100%' align='center' border='0' cellspacing='0' cellpadding='0'>
    <tr>
    <td bgcolor='$style[CellA]' colspan=2>
    <table width='100%' align='center' border='0' cellspacing='0' cellpadding='0'>
        <tr><td>
            $style[stdfont]$post[posttext]$style[stdfontend]
        </tr></td>
    </table>
    </td>
    </tr>
    <tr><td>
    <table width='100%' align='center' border='0' cellspacing='0' cellpadding='0'><tr>
        <td bgcolor='$style[CellB]'>$portal_thread[threadcreationtime] von $portal_thread[threadauthor]</td>
        <td bgcolor='$style[CellB]' align='right'><a href='showtopic.php?threadid=$portal_thread[threadid]'>Kommentare ($portal_thread[threadreplies])</a></td></tr>
    </table>
    </td></tr>
    </table>";
    $portalrowtitle=$portal_thread[threadtopic];
    $portalrow=$news;
    eval($TPortalrow->GetTemplate(PORTAL_MAIN));
}

$result_topics = thwb_query("SELECT COUNT(*) FROM ".$pref."thread WHERE boardid='".$portalconfig['newsforumid']."'");
$topics = mysql_fetch_row($result_topics);

if ($topics[0] > $portalconfig['newsperpage'])
{ 
$count=0;
$begin=0;
while ($count < $topics[0])
{
   $count=$count+$portalconfig['newsperpage'];
   $begin2=$begin+1;

   if ($topics[0]-$count<0)
   $end=$topics[0];
   else $end=$begin2+$portalconfig['newsperpage']-1;

   $portal_pages .= "<span class='smalltext'>[<a href=$phpself?begin=$begin>$begin2-$end</a>] </span>";
   $begin=$begin+$portalconfig['newsperpage'];
}
}
}
/////////////////////
//news end
/////////////////////

ich wollte nun gern obn im query auch noch die "threadviews" auslesen & die dann bei jeder news mit angebn... so nach dem motto:
NEWS...
x-mal gelesen
in etwa so wies im news-script fürs wbb ist! das ich die threadviews-variable mit reintu in den query war mir auch klar... aber bei der darauffolgenden verarbeitung versagt mein wissn... ich bekam dann nur noch parse errors... könnte mir da mal jemand weiterhelfn? wär echt nett! :rolleyes:

/EURdit
kk, narodnaja war so nett & hat mir geholfen... hab das ganze ma na meinen wünschn umgebastlt. wer das ergebnis sehn will... HIER

THX nochma an narodnaja!!! :)

Seite 1 von 1