Sorry Jungz wusste nicht wie ich es beschreiben soll gg
Habe folgendes Problem
ich möchte das diese Datei die ich hier poste nur den Titel mit Link ausgibt. Was muss ich weglassen bzw was muss übrig bleiben?
Momentan gibt diese Script mehrere Sachen aus wie: Name, gepostet am, Voten, ID, Beschreibung, Fromat etc.
Also wie gesagt ich möchte das Sie nur ausgibt
Titel und LINK
Alles anzeigen
Danke für eure Mühe
Habe folgendes Problem
ich möchte das diese Datei die ich hier poste nur den Titel mit Link ausgibt. Was muss ich weglassen bzw was muss übrig bleiben?
Momentan gibt diese Script mehrere Sachen aus wie: Name, gepostet am, Voten, ID, Beschreibung, Fromat etc.
Also wie gesagt ich möchte das Sie nur ausgibt
Titel und LINK
Quellcode
- <?
- #################################################
- # xLinks 2002 #
- #################################################
- # © by Robert Klikics | http://x-dev.de #
- # eMail: rob@x-dev.de #
- #################################################
- # License: GPL #
- # please don't remove this copyright - thx #
- #################################################
- # FILE: view.php #
- #################################################
- // die if !$cat
- if(!$cat) die("<h4>Script says: \"I need a category to show!!!\" ");
- #======================================================================#
- # the includes & mySQL-conn
- #======================================================================#
- require("./inc/conf.inc.php"); // cfg
- require("./inc/connect.php"); // mySQL
- require("./lang/$language"); // language-file
- include("./inc/head.inc"); // header
- //set table-vars
- $table_linkdata = $db_prefix."linkdata";
- $table_cat = $db_prefix."cat";
- $table_votes = $db_prefix."votes";
- $table_languages = $db_prefix."languages";
- //Connect to mySQL
- $conn = @MYSQL_CONNECT($server, $user, $pass);
- //Select DB
- @MYSQL_SELECT_DB($mydb) or die ("<h1>Database '$mydb' does not exist or mySQL is not connected!<p>Please check your settings ...</h1>");
- //Check
- if(!$conn) die("<h1>mySQL-Connection-Error<br>Check your settings ...</h1>");
- #======================================================================#
- # add vote to db & check if already voted
- #======================================================================#
- if($yourvote)
- {
- //save vote in db
- $sql = "INSERT INTO $table_votes (vote, link_id, cat)";
- $sql.= "VALUES ('$yourvote', '$id', '$cat')";
- MYSQL_QUERY($sql);
- //vote counter +1
- MYSQL_QUERY("UPDATE $table_linkdata SET hp_votes = hp_votes + 1 WHERE id = $id");
- // generate actual vote-count and put into "LINKDATA-->hp_votes"
- $result = MYSQL_QUERY("SELECT vote FROM $table_votes WHERE link_id = $id");
- $anzahl = MYSQL_NUM_ROWS($result);
- while ($row = MYSQL_FETCH_ARRAY($result)) { $allvotes = $allvotes + $row[vote]; } // summary of votes for an id
- if($anzahl == 1) $allvotes = $yourvote; // set $allvotes to 1, if it's the first one
- $av_votes = round($allvotes / $anzahl, 1); // get & round the average-votes
- // put $av_votes to db
- MYSQL_QUERY("UPDATE $table_linkdata SET hp_vote = $av_votes WHERE id = $id");
- // show auto-link if vote added
- echo <<<end_xx
- <meta http-equiv="refresh" content="2; URL=$PHP_SELF?cat=$cat&s=$s">
- <table width="100%" border="0" cellspacing="3" cellpadding="3" height="95%">
- <tr valign="middle" align="center">
- <td>
- end_xx;
- echo "\n<font size='2'>".VIEW_VOTE_AUTOLINK."</b>\n";
- echo "<p>[ <a href='$PHP_SELF?cat=$cat&s=$s'>link</a> ]";
- echo <<<end_x
- </td>
- </tr>
- </table>
- </body>
- </html>
- end_x;
- exit;
- } // endif $yourvote
- #======================================================================#
- # get data from db by right order ...
- #======================================================================#
- if(($cat) && (!$yourvote))
- {
- if($sort == "new" || $incatsort == "id") { $incatsort = "id"; $sortby = "DESC"; $act_sort = VIEW_SORTING_NEW; } // sorting by old/new
- if($sort == "old") { $incatsort = "id"; $sortby = "ASC"; $act_sort = VIEW_SORTING_OLD; }
- if($sort == "vote" || $incatsort == "hp_vote") { $incatsort = "hp_vote"; $sortby = "DESC"; $act_sort = VIEW_SORT_BY_VOTE; } //sort by rating
- if($sort == "hits" || $incatsort == "hp_votes") { $incatsort = "Hits"; $sortby = "DESC"; $act_sort = VIEW_SORT_BY_HITS; } //sort by hits
- if($sort == "name" || $incatsort == "name") { $incatsort = "name"; $sortby = "ASC"; $act_sort = VIEW_SORTING_NAME; } //sort by name
- //when searching
- if($cat == "search") {
- $result = MYSQL_QUERY("SELECT * FROM $table_linkdata WHERE name LIKE \"%$q%\" order by $incatsort $sortby LIMIT 0,$max_search "); // get seach-query's to $max_search
- $scnt = MYSQL_NUM_ROWS($result);
- } else {
- if(!$s) { $showfrom = 0; $datasets = $perpage; // params for default--output (on 1 page)
- } else {
- $showfrom = $s; $datasets = $perpage; } // set params for page--output (multiple pages)
- // get total number of links in a cat
- $countz = MYSQL_QUERY("SELECT COUNT(id) FROM $table_linkdata WHERE cat = $cat ");
- $anz = MYSQL_RESULT($countz,0);
- MYSQL_FREE_RESULT($countz); //mem
- $result = MYSQL_QUERY("SELECT * FROM $table_linkdata WHERE cat = $cat order by $incatsort $sortby LIMIT $showfrom,$datasets "); //get linkdata
- } //endif $search
- #======================================================================#
- # javascript for jump-menu
- #======================================================================#
- ?>
- <script language='javascript'>
- <!--
- // jump-menu
- function jumper(targ,selObj,restore)
- {
- eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
- if (restore) selObj.selectedIndex=0;
- }
- //-->
- </script>
- <p>
- <table width="100%" border="0" cellspacing="3" cellpadding="3" height="95%">
- <tr valign="middle" align="center">
- <td>
- <table border='0' cellspacing='1' cellpadding='1' align='center' width='<?=$linkwidth?>'>
- <tr>
- <td align='center'>
- <?
- #======================================================================#
- # render cat-info & some NAVI-links
- #======================================================================#
- if($cat != "search") //show not if searching
- {
- $hello = MYSQL_QUERY("SELECT * FROM $table_cat WHERE id = $cat"); // get cat-info
- $world = MYSQL_FETCH_ARRAY($hello);
- echo "\n\n<!-- powered by xLinks [ © http://x-dev.de - get it there ] -->\n\n";
- echo "<h4>$listname | ".VIEW_BEFORE_CAT_TXT." '$world[name]'</h4>\n"; // print cat-info
- echo "</td>\n</tr>\n";
- MYSQL_FREE_RESULT($hello); // give memory free
- } else {
- echo "<h4>$listname | ".SEARCH_RESULTS." $q ($max_search max.)</h4>\n"; } // print search-resluts header
- #======================================================================#
- # render output-table for each link
- #======================================================================#
- if(!$scnt && $cat == "search") echo SEARCH_NO_RESULTS; // msg if no search-results found
- //function to generate the <select>-field for 'vote'
- function VoteSelect()
- {
- global $PHP_SELF;
- global $cat;
- global $row;
- global $s;
- // <select> for vote
- echo "\t<select name='a_vote' onchange=\"jumper('self',this,0)\">\n";
- echo "\t<option>".VIEW_VOTE_SELECT."\n";
- echo "\t<option value='$PHP_SELF?cat=$cat&id=$row[id]&s=$s&yourvote=1'>1 - ".VIEW_BADDEST_VOTE."\n";
- echo "\t<option value='$PHP_SELF?cat=$cat&id=$row[id]&s=$s&yourvote=2'>2\n";
- echo "\t<option value='$PHP_SELF?cat=$cat&id=$row[id]&s=$s&yourvote=3'>3\n";
- echo "\t<option value='$PHP_SELF?cat=$cat&id=$row[id]&s=$s&yourvote=4'>4\n";
- echo "\t<option value='$PHP_SELF?cat=$cat&id=$row[id]&s=$s&yourvote=5'>5\n";
- echo "\t<option value='$PHP_SELF?cat=$cat&id=$row[id]&s=$s&yourvote=6'>6\n";
- echo "\t<option value='$PHP_SELF?cat=$cat&id=$row[id]&s=$s&yourvote=7'>7\n";
- echo "\t<option value='$PHP_SELF?cat=$cat&id=$row[id]&s=$s&yourvote=8'>8\n";
- echo "\t<option value='$PHP_SELF?cat=$cat&id=$row[id]&s=$s&yourvote=9'>9\n";
- echo "\t<option value='$PHP_SELF?cat=$cat&id=$row[id]&s=$s&yourvote=10'>10 - ".VIEW_BEST_VOTE."\n";
- echo "\t</select>\n";
- }
- while ($row = MYSQL_FETCH_ARRAY($result))
- {
- // get date of posting and format as set
- if($timeformat == 1) $pd = strftime("%d.%m.%Y", $row[poster_time]);
- elseif($timeformat == 2) $pd = strftime("%A, %d-%m-%Y %R", $row[poster_time]);
- elseif($timeformat == 3) $pd = strftime("%d-%m-%Y", $row[poster_time]);
- else $pd = strftime("%Y-%d-%m", $row[poster_time]);
- //strip-slashes
- if($html == "ON")
- {
- $row[hp_desc] = stripslashes($row[hp_desc]);
- $row[name] = stripslashes($row[name]);
- $row[url] = stripslashes($row[url]);
- $row[poster_name] = stripslashes($row[poster_name]);
- $row[poster_email] = stripslashes($row[poster_email]);
- }
- // include design.inc.php and render table's
- include("inc/design.inc.php");
- }
- MYSQL_FREE_RESULT($result); // give memory free
- } //endif $cat
- ?>
- <br>
- <table border='0' align='center' width='<?=$linkwidth?>'>
- <tr>
- <td align='left'><a href='javascript:scroll(0,0)'><?=VIEW_LINK_TOP;?></a></td>
- <td align='right'>
- <?
- // <select> for catjump
- echo VIEW_CATJUMP_SEL." ";
- echo "<select name='mycatisjumping' onchange=\"jumper('self',this,0)\" onmouseover='this.focus()'>\n";
- echo "<option value=''>".ADD_HP_CAT_SELECT."\n";
- $sweet = MYSQL_QUERY("SELECT * FROM $table_cat order by $catorder");
- while ($cats = MYSQL_FETCH_ARRAY($sweet))
- {
- if($cats[id] != $cat) echo "<option value='$PHP_SELF?cat=$cats[id]&sort=$sort'>$cats[name]\n"; // render cat-selection
- }
- MYSQL_FREE_RESULT($sweet); // give memory free
- echo "</select>\n";
- ?>
- </td>
- </tr>
- </table>
- <br>
- <table border='0' align='center' width='<?=$linkwidth?>'>
- <tr>
- <td align='center'>
- <?
- #======================================================================#
- # navigation @ page bottom of the cat-view
- # (only if not searching)
- #======================================================================#
- if($cat != "search")
- {
- //var's
- $ges = $anz / $perpage;
- if(is_integer($ges)) $pgcnt = $ges;
- else $pgcnt = $ges + 1; // get page-counter in a cat
- //$lastpg = $anz - $perpage; // $s of last page
- $actpg = $s / $perpage + 1; // get number of actual page
- $sh_to = $showfrom + $perpage; // $s for next page
- $sh_strt = $showfrom - $perpage; // $s for prev. page
- if($sh_to > $anz) $sh_to = $anz; // ---- "" ----
- if($sort) $linkvar = "&sort=$sort"; // string for sorting if set
- //output
- if($s) echo "[ <a href='$PHP_SELF?cat=$cat&s=$sh_strt$linkvar'><</a> ] ::\n";
- echo "<b>[</b> ".VIEW_LINKS_PAGE." $actpg ".VIEW_LINKS_FROM." ".sprintf("%d","$pgcnt")." <b>]</b> ";
- if($s + $perpage < $anz) echo ":: [ <a href='$PHP_SELF?cat=$cat&s=$sh_to$linkvar'>></a> ]\n";
- } //endif $q
- // HTML:
- ?>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <?
- #======================================================================#
- # footer &
- # END OF FILE
- #======================================================================#
- // PLEASE DONT CHANGE THIS [for dev]
- #################################################################################################################
- echo "\n<!-- some copyright, please don't remove :: thank you [ http://x-dev.de ] -->\n"; #
- echo "\n<p align='center'>© <a href='jump.php?id=x' target='_blank'>xLinks</a> 2002\n"; # #
- //disconnect from mySQL #
- MYSQL_CLOSE(); #
- #################################################################################################################
- include("./inc/foot.inc");
- ?>
Danke für eure Mühe