DE - AllgemeinNewslayout und Matchviewer


23.05.2012, 10:33 - Bonk - webSPELL newbie - 12 Posts
Hallo zusammen,

ich hab 2 sehr nervige Probleme mit unserer Seite. Hoffe ihr könnt mir irgendwie helfen.

Problem 1: Newstext verringern + Mehr... integrieren

Ich würde gerne den angezeigten Text pro News auf ca. 200 - 300 Buchstaben limitieren und wenn es mehr Text geben sollte mit "Mehr..." zur vollständigen News-Seite weiterleiten.

Hier der PHP-Code:
Code:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
325.
326.
327.
328.
329.
330.
331.
332.
333.
334.
335.
336.
337.
338.
339.
340.
341.
342.
343.
344.
345.
346.
347.
348.
349.
350.
351.
352.
353.
354.
355.
356.
357.
358.
359.
360.
361.
362.
363.
364.
365.
366.
367.
368.
369.
370.
371.
372.
373.
374.
375.
376.
377.
378.
379.
380.
381.
382.
383.
384.
385.
386.
387.
388.
389.
390.
391.
392.
393.
394.
395.
396.
397.
398.
399.
400.
401.
402.
403.
404.
405.
406.
407.
408.
409.
410.
411.
412.
413.
414.
415.
416.
417.
418.
419.
420.
421.
422.
423.
424.
425.
426.
427.
428.
429.
430.
431.
432.
433.
434.
435.
436.
437.
438.
439.
440.
441.
442.
443.
444.
445.
446.
447.
448.
449.
450.
451.
452.
453.
454.
455.
456.
457.
458.
459.
460.
461.
462.
463.
464.
465.
466.
467.
468.
469.
470.
471.
472.
473.
474.
475.
476.
477.
478.
479.
480.
481.
482.
483.
484.
485.
486.
487.
488.
489.
490.
491.
492.
493.
494.
495.
496.
497.
498.
499.
500.
501.
502.
503.
504.
505.
506.
507.
508.
509.
510.
511.
512.
513.
514.
515.
516.
517.
518.
519.
520.
521.
522.
523.
524.
525.
526.
527.
528.
529.
530.
531.
532.
533.
534.
535.
536.
537.
538.
539.
540.
541.
542.
543.
544.
545.
546.
547.
548.
549.
550.
551.
552.
553.
554.
555.
556.
557.
558.
559.
560.
561.
562.
563.
564.
565.
566.
567.
568.
569.
570.
571.
572.
573.
574.
575.
576.
577.
578.
579.
580.
581.
582.
583.
584.
585.
586.
587.
588.
589.
590.
591.
592.
593.
594.
595.
596.
597.
598.
599.
600.
601.
602.
603.
604.
605.
606.
607.
608.
609.
610.
611.
612.
613.
614.
615.
616.
617.
618.
619.
620.
621.
622.
623.
624.
625.
626.
627.
628.
629.
630.
631.
632.
633.
634.
635.
636.
637.
638.
639.
640.
641.
642.
643.
644.
645.
646.
647.
648.
649.
650.
651.
652.
653.
654.
655.
656.
657.
658.
659.
660.
661.
662.
663.
664.
665.
666.
667.
668.
669.
670.
671.
672.
673.
674.
675.
676.
677.
678.
679.
680.
681.
682.
683.
684.
685.
686.
687.
688.
689.
690.
691.
692.
693.
694.
695.
696.
697.
698.
699.
700.
701.
702.
703.
704.
705.
706.
707.
708.
709.
710.
711.
712.
713.
714.
715.
716.
717.
718.
719.
720.
721.
722.
723.
724.
725.
726.
727.
728.
729.
730.
731.
732.
733.
734.
735.
736.
737.
738.
739.
740.
741.
742.
743.
744.
745.
746.
747.
748.
749.
750.
751.
752.
753.
754.
755.
756.
757.
758.
759.
760.
761.
762.
763.
764.
765.
766.
767.
768.
769.
770.
771.
772.
773.
774.
775.
776.
777.
778.
779.
780.
781.
782.
783.
784.
785.
786.
787.
788.
789.
790.
791.
792.
793.
794.
795.
796.
797.
798.
799.
800.
801.
802.
803.
804.
805.
806.
807.
808.
809.
810.
811.
812.
813.
814.
815.
816.
817.
818.
819.
820.
821.
822.
823.
824.
825.
826.
827.
828.
829.
830.
831.
832.
833.
834.
835.
836.
837.
838.
839.
840.
841.
842.
843.
844.
845.
846.
847.
848.
849.
850.
851.
852.
853.
854.
855.
856.
857.
858.
859.
860.
861.
862.
863.
864.
865.
866.
867.
868.
869.
870.
871.
872.
873.
874.
875.
876.
877.
878.
879.
880.
881.
882.
883.
884.
885.
886.
887.
888.
889.
890.
891.
892.
893.
894.
895.
896.
897.
898.
899.
900.
901.
902.
903.
904.
905.
906.
907.
908.
909.
910.
911.
912.
913.
914.
915.
916.
917.
918.
919.
920.
921.
922.
923.
924.
925.
926.
927.
928.
929.
930.
931.
932.
933.
934.
935.
936.
937.
938.
939.
940.
941.
942.
943.
944.
945.
946.
947.
948.
949.
950.
951.
952.
953.
954.
955.
956.
957.
958.
959.
960.
961.
962.
963.
964.
965.
966.
967.
968.
969.
970.
971.
972.
973.
974.
975.
976.
977.
978.
979.
980.
981.
982.
983.
984.
985.
986.
987.
if(isset($_GET['action'])) $action = $_GET['action'];
else $action='';
if(isset($_REQUEST['quickactiontype'])) $quickactiontype = $_REQUEST['quickactiontype'];
else $quickactiontype='';

if($action=="new") {
  include("_mysql.php");
  include("_settings.php");
  include("_functions.php");
  $_language->read_module('news');
  $_language->read_module('bbcode', true);
  if(!isnewswriter($userID)) die($_language->module['no_access']);

  safe_query("INSERT INTO ".PREFIX."news (date, poster, saved) VALUES ('".time()."', '".$userID."', '0')");
  $newsID=mysql_insert_id();

  $rubrics='';
  $newsrubrics=safe_query("SELECT rubricID, rubric FROM ".PREFIX."news_rubrics ORDER BY rubric");
  while($dr=mysql_fetch_array($newsrubrics)) {
    $rubrics.='<option value="'.$dr['rubricID'].'">'.$dr['rubric'].'</option>';
  }

  if(isset($_POST['topnews'])) safe_query("UPDATE ".PREFIX."settings SET topnewsID='$newsID'");

  $count_langs = 0;
  $lang=safe_query("SELECT lang, language FROM ".PREFIX."news_languages ORDER BY language");
  $langs='';
  while($dl=mysql_fetch_array($lang)) {
    $langs.="news_languages[".$count_langs."] = new Array();\nnews_languages[".$count_langs."][0] = '".$dl['lang']."';\nnews_languages[".$count_langs."][1] = '".$dl['language']."';\n";
    $count_langs++;
  }

  $message_vars='';
  $headline_vars='';
  $langs_vars='';
  $langcount=1;

  $url1="http://";
  $url2="http://";
  $url3="http://";
  $url4="http://";
  $link1='';
  $link2='';
  $link3='';
  $link4='';
  $window1_new = 'checked="checked"';
  $window1_self = '';
  $window2_new = 'checked="checked"';
  $window2_self = '';
  $window3_new = 'checked="checked"';
  $window3_self = '';
  $window4_new = 'checked="checked"';
  $window4_self = '';
  $intern = '<option value="0" selected="selected">'.$_language->module['no'].'</option><option value="1">'.$_language->module['yes'].'</option>';
  $topnews = '<option value="0" selected="selected">'.$_language->module['no'].'</option><option value="1">'.$_language->module['yes'].'</option>';

  $bg1=BG_1;

  $selects='';
  for($i = 1; $i <= $count_langs; $i++) {
    $selects .= '<option value="'.$i.'">'.$i.'</option>';
  }

  $postform = '';
  $comments='<option value="0">'.$_language->module['no_comments'].'</option><option value="1">'.$_language->module['user_comments'].'</option><option value="2" selected="selected">'.$_language->module['visitor_comments'].'</option>';
 
  eval ("\$addbbcode = \"".gettemplate("addbbcode")."\";");
  eval ("\$addflags = \"".gettemplate("flags")."\";");

  eval ("\$news_post = \"".gettemplate("news_post")."\";");
  echo $news_post;
}
elseif($action=="save") {
  include("_mysql.php");
  include("_settings.php");
  include("_functions.php");
  $_language->read_module('news');
  $newsID = $_POST['newsID'];

  $ds=mysql_fetch_array(safe_query("SELECT poster FROM ".PREFIX."news WHERE newsID = '".$newsID."'"));
  if(($ds['poster'] != $userID or !isnewswriter($userID)) and !isnewsadmin($userID)) {
    die($_language->module['no_access']);
  }

  $save = isset($_POST['save']);
  $preview = isset($_POST['preview']);

  if(isset($_POST['rubric'])) $rubric = $_POST['rubric'];
  else $rubric = 0;

  $lang = $_POST['lang'];
  $headline = $_POST['headline'];
  $message = $_POST['message'];
  $message = str_replace('\r\n', "\n", $message);

  $link1 = strip_tags($_POST['link1']);
  $url1 = strip_tags($_POST['url1']);
  $window1 = $_POST['window1'];

  $link2 = strip_tags($_POST['link2']);
  $url2 = strip_tags($_POST['url2']);
  $window2 = $_POST['window2'];

  $link3 = strip_tags($_POST['link3']);
  $url3 = strip_tags($_POST['url3']);
  $window3 = $_POST['window3'];

  $link4 = strip_tags($_POST['link4']);
  $url4 = strip_tags($_POST['url4']);
  $window4 = $_POST['window4'];

  $type = $_POST['type'];
  $intern = $_POST['intern'];
  $comments = $_POST['comments'];

  safe_query("UPDATE ".PREFIX."news SET rubric='".$rubric."',
                      link1='".$link1."',
                      url1='".$url1."',
                      window1='".$window1."',
                      link2='".$link2."',
                      url2='".$url2."',
                      window2='".$window2."',
                      link3='".$link3."',
                      url3='".$url3."',
                      window3='".$window3."',
                      link4='".$link4."',
                      url4='".$url4."',
                      window4='".$window4."',
                      saved='1',
                      type='".$type."',
            intern='".$intern."',
                      comments='".$comments."' WHERE newsID='".$newsID."'");

  $update_langs = array();
  $query = safe_query("SELECT language FROM ".PREFIX."news_contents WHERE newsID = '".$newsID."'");
  while($qs = mysql_fetch_array($query)) {
    $update_langs[] = $qs['language'];
    if(in_array($qs['language'], $lang)) {
      $update_langs[] = $qs['language'];
    }
    else {
      safe_query("DELETE FROM ".PREFIX."news_contents WHERE newsID = '".$newsID."' and language = '".$qs['language']."'");
    }
  }

  for($i = 0; $i < count($message); $i++) {
    if(in_array($lang[$i], $update_langs)) {
      safe_query("UPDATE ".PREFIX."news_contents SET headline = '".$headline[$i]."', content = '".$message[$i]."' WHERE newsID = '".$newsID."' and language = '".$lang[$i]."'");
      unset($update_langs[$lang[$i]]);
    }
    else {
      safe_query("INSERT INTO ".PREFIX."news_contents (newsID, language, headline, content) VALUES ('".$newsID."', '".$lang[$i]."', '".$headline[$i]."', '".$message[$i]."')");
    }
  }

  // delete the entries that are older than 2 hour and contain no text
  safe_query("DELETE FROM `".PREFIX."news` WHERE `saved` = '0' and ".time()." - `date` > ".(2 * 60 * 60));

  if(isset($_POST['topnews'])) {
    if($_POST['topnews']) {
      safe_query("UPDATE ".PREFIX."settings SET topnewsID='".$newsID."'");
    }
    elseif(!$_POST['topnews'] and $newsID == $topnewsID) {
      safe_query("UPDATE ".PREFIX."settings SET topnewsID='0'");
    }
  }
  generate_rss2();
  if($save) echo'<body onload="window.close()"></body>';
  if($preview) header("Location: news.php?action=preview&newsID=".$newsID);
  if($languagecount) header("Location: news.php?action=edit&newsID=".$newsID);

}
elseif($action=="preview") {
  include("_mysql.php");
  include("_settings.php");
  include("_functions.php");
  $_language->read_module('news');

  $newsID = $_GET['newsID'];

  $result=safe_query("SELECT * FROM ".PREFIX."news WHERE newsID='$newsID'");
  $ds=mysql_fetch_array($result);

  if(($ds['poster'] != $userID or !isnewswriter($userID)) and !isnewsadmin($userID)) {
    die($_language->module['no_access']);
  }

  echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta name="description" content="Clanpage using webSPELL 4 CMS" />
  <meta name="author" content="webspell.org" />
  <meta name="keywords" content="webspell, webspell4, clan, cms" />
  <meta name="copyright" content="Copyright &copy; 2005 - 2009 by webspell.org" />
  <meta name="generator" content="webSPELL" />

<!-- Head & Title include -->
  <title>'.PAGETITLE.'; ?></title>
  <link href="_stylesheet.css" rel="stylesheet" type="text/css" />
  <script src="js/bbcode.js" language="jscript" type="text/javascript"></script>
<!-- end Head & Title include -->
</head>
<body>';

  $bg1=BG_1;

  eval ("\$title_news = \"".gettemplate("title_news")."\";");
  echo $title_news;

  $bgcolor=BG_1;
  $date = date("d.m.Y", $ds['date']);
  $time = date("H:i", $ds['date']);
  $rubrikname=getrubricname($ds['rubric']);
  $rubrikname_link = getinput(getrubricname($ds['rubric']));
  $rubricpic='<img src="images/news-rubrics/'.getrubricpic($ds['rubric']).'" alt="" />';
  if(!file_exists($rubricpic)) $rubricpic = '';

  $adminaction='';

  $message_array = array();
  $query=safe_query("SELECT * FROM ".PREFIX."news_contents WHERE newsID='".$newsID."'");
  while($qs = mysql_fetch_array($query)) {
    $message_array[] = array('lang' => $qs['language'], 'headline' => $qs['headline'], 'message' => $qs['content']);
  }
  $showlang = select_language($message_array);

  $langs='';
  $i=0;
  foreach($message_array as $val) {
    if($showlang!=$i) $langs.='<a href="index.php?site=news_comments&amp;newsID='.$ds['newsID'].'&amp;lang='.$val['lang'].'">'.$val['lang'].'</a>';
    $i++;
  }
  $langs = flags($langs);

  $headline=$message_array[$showlang]['headline'];
  $content=$message_array[$showlang]['message'];
 
  if($ds['intern'] == 1) $isintern = '('.$_language->module['intern'].')';
    else $isintern = '';
   
  $content = htmloutput($content);
  $content = toggle($content, $ds['newsID']);
  $poster='<a href="index.php?site=profile&amp;id='.$ds['poster'].'"><b>'.getnickname($ds['poster']).'</b></a>';
  $related='';
  $comments="";
  if($ds['link1'] && $ds['url1']!="http://" && $ds['window1']) $related.='&#8226; <a href="'.$ds['url1'].'" target="_blank">'.$ds['link1'].'</a> ';
  if($ds['link1'] && $ds['url1']!="http://" && !$ds['window1']) $related.='&#8226; <a href="'.$ds['url1'].'">'.$ds['link1'].'</a> ';

  if($ds['link2'] && $ds['url2']!="http://" && $ds['window2']) $related.='&#8226; <a href="'.$ds['url2'].'" target="_blank">'.$ds['link2'].'</a> ';
  if($ds['link2'] && $ds['url2']!="http://" && !$ds['window2']) $related.='&#8226; <a href="'.$ds['url2'].'">'.$ds['link2'].'</a> ';

  if($ds['link3'] && $ds['url3']!="http://" && $ds['window3']) $related.='&#8226; <a href="'.$ds['url3'].'" target="_blank">'.$ds['link3'].'</a> ';
  if($ds['link3'] && $ds['url3']!="http://" && !$ds['window3']) $related.='&#8226; <a href="'.$ds['url3'].'">'.$ds['link3'].'</a> ';

  if($ds['link4'] && $ds['url4']!="http://" && $ds['window4']) $related.='&#8226; <a href="'.$ds['url4'].'" target="_blank">'.$ds['link4'].'</a> ';
  if($ds['link4'] && $ds['url4']!="http://" && !$ds['window4']) $related.='&#8226; <a href="'.$ds['url4'].'">'.$ds['link4'].'</a> ';

  eval ("\$news = \"".gettemplate("news")."\";");
  echo $news;

  echo'<hr />
  <input type="button" onclick="MM_goToURL(\'parent\',\'news.php?action=edit&amp;newsID='.$newsID.'\');return document.MM_returnValue" value="'.$_language->module['edit'].'" />
  <input type="button" onclick="javascript:self.close()" value="'.$_language->module['save_news'].'" />
  <input type="button" onclick="MM_confirm(\''.$_language->module['really_delete'].'\', \'news.php?action=delete&amp;id='.$newsID.'&amp;close=true\')" value="'.$_language->module['delete'].'" /></body></html>';
}
elseif($quickactiontype=="publish") {
  include("_mysql.php");
  include("_settings.php");
  include("_functions.php");
  $_language->read_module('news');
  if(!isnewsadmin($userID)) die($_language->module['no_access']);

  if(isset($_POST['newsID'])){
    $newsID = $_POST['newsID'];
    if(is_array($newsID)) {
      foreach($newsID as $id) {
        safe_query("UPDATE ".PREFIX."news SET published='1' WHERE newsID='".(int)$id."'");
      }
    } else safe_query("UPDATE ".PREFIX."news SET published='1' WHERE newsID='".(int)$newsID."'");
    generate_rss2();
    header("Location: index.php?site=news");
  }
  else{
    header("Location: index.php?site=news&action=unpublished");
  }
}
elseif($quickactiontype=="unpublish") {
  include("_mysql.php");
  include("_settings.php");
  include("_functions.php");
  $_language->read_module('news');
  if(!isnewsadmin($userID)) die($_language->module['no_access']);
 
  if(isset($_REQUEST['newsID'])){
    $newsID = $_REQUEST['newsID'];
    if(is_array($newsID)) {
      foreach($newsID as $id) {
        safe_query("UPDATE ".PREFIX."news SET published='0' WHERE newsID='".(int)$id."'");
      }
    }
    else safe_query("UPDATE ".PREFIX."news SET published='0' WHERE newsID='".(int)$newsID."'");
    generate_rss2();
  }
  header("Location: index.php?site=news");
}
elseif($quickactiontype=="delete") {
  include("_mysql.php");
  include("_settings.php");
  include("_functions.php");
  $_language->read_module('news');
  if(isset($_POST['newsID'])){
    $newsID = $_POST['newsID'];
 
    foreach($newsID as $id) {
      $ds=mysql_fetch_array(safe_query("SELECT screens, poster FROM ".PREFIX."news WHERE newsID='".$id."'"));
      if(($ds['poster'] != $userID or !isnewswriter($userID)) and !isnewsadmin($userID)) {
        die($_language->module['no_access']);
      }
      if($ds['screens']) {
        $screens=explode("|", $ds['screens']);
        if(is_array($screens)) {
          $filepath = "./images/news-pics/";
          foreach($screens as $screen) {
            if(file_exists($filepath.$screen)) @unlink($filepath.$screen);
          }
        }
      }
      safe_query("DELETE FROM ".PREFIX."news WHERE newsID='".$id."'");
      safe_query("DELETE FROM ".PREFIX."news_contents WHERE newsID='".$id."'");
      safe_query("DELETE FROM ".PREFIX."comments WHERE parentID='".$id."' AND type='ne'");
    }
    generate_rss2();
    header("Location: index.php?site=news&action=archive");
  }
  else{
    generate_rss2();
    header("Location: index.php?site=news&action=archive");
  }
}
elseif($action=="delete") {
  include("_mysql.php");
  include("_settings.php");
  include("_functions.php");
  $_language->read_module('news');

  $id = $_GET['id'];

  $ds=mysql_fetch_array(safe_query("SELECT screens, poster FROM ".PREFIX."news WHERE newsID='".$id."'"));
  if(($ds['poster'] != $userID or !isnewswriter($userID)) and !isnewsadmin($userID)) {
    die($_language->module['no_access']);
  }
  if($ds['screens']) {
    $screens=explode("|", $ds['screens']);
    if(is_array($screens)) {
      $filepath = "./images/news-pics/";
      foreach($screens as $screen) {
        if(file_exists($filepath.$screen)) @unlink($filepath.$screen);
      }
    }
  }

  safe_query("DELETE FROM ".PREFIX."news WHERE newsID='".$id."'");
  safe_query("DELETE FROM ".PREFIX."news_contents WHERE newsID='".$id."'");
  safe_query("DELETE FROM ".PREFIX."comments WHERE parentID='".$id."' AND type='ne'");
 
  generate_rss2();
  if(isset($_GET['close'])) echo'<body onload="window.close()"></body>';
  else header("Location: index.php?site=news");
}
elseif($action=="edit") {
  include("_mysql.php");
  include("_settings.php");
  include("_functions.php");
  $_language->read_module('news');

  $newsID = $_GET['newsID'];

  $ds=mysql_fetch_array(safe_query("SELECT * FROM ".PREFIX."news WHERE newsID='".$newsID."'"));
  if(($ds['poster'] != $userID or !isnewswriter($userID)) and !isnewsadmin($userID)) {
    die($_language->module['no_access']);
  }

  $_language->read_module('bbcode', true);


  $message_array = array();
  $query=safe_query("SELECT * FROM ".PREFIX."news_contents WHERE newsID='".$newsID."'");
  while($qs = mysql_fetch_array($query)) {
    $message_array[] = array('lang' => $qs['language'], 'headline' => $qs['headline'], 'message' => $qs['content']);
  }

  $count_langs = 0;
  $lang=safe_query("SELECT lang, language FROM ".PREFIX."news_languages ORDER BY language");
  $langs='';
  while($dl=mysql_fetch_array($lang)) {
    $langs.="news_languages[".$count_langs."] = new Array();\nnews_languages[".$count_langs."][0] = '".$dl['lang']."';\nnews_languages[".$count_langs."][1] = '".$dl['language']."';\n";
    $count_langs++;
  }

  $message_vars='';
  $headline_vars='';
  $langs_vars='';
  $i=0;
  foreach($message_array as $val) {
    $message_vars .= "message[".$i."] = '".js_replace($val['message'])."';\n";
    $headline_vars .= "headline[".$i."] = '".js_replace(htmlspecialchars($val['headline']))."';\n";
    $langs_vars .= "langs[".$i."] = '".$val['lang']."';\n";
    $i++;
  }
  $langcount = $i;

  $newsrubrics=safe_query("SELECT * FROM ".PREFIX."news_rubrics ORDER BY rubric");
  $rubrics='';
  while($dr=mysql_fetch_array($newsrubrics)) {
    if($ds['rubric']==$dr['rubricID']) $rubrics.='<option value="'.$dr['rubricID'].'" selected="selected">'.getinput($dr['rubric']).'</option>';
    else $rubrics.='<option value="'.$dr['rubricID'].'">'.getinput($dr['rubric']).'</option>';
  }

  if($ds['intern']) $intern = '<option value="0">'.$_language->module['no'].'</option><option value="1" selected="selected">'.$_language->module['yes'].'</option>';
  else $intern = '<option value="0" selected="selected">'.$_language->module['no'].'</option><option value="1">'.$_language->module['yes'].'</option>';
 
  if($ds['type']) $type = '<option value="0">'.$_language->module['news'].'</option><option value="1" selected="selected">'.$_language->module['scene_news'].'</option>';
  else $type = '<option value="0" selected="selected">'.$_language->module['news'].'</option><option value="1">'.$_language->module['scene_news'].'</option>';
 
  if($topnewsID == $newsID) $topnews = '<option value="0">'.$_language->module['no'].'</option><option value="1" selected="selected">'.$_language->module['yes'].'</option>';
  else $topnews = '<option value="0" selected="selected">'.$_language->module['no'].'</option><option value="1">'.$_language->module['yes'].'</option>';

  $selects='';
  for($i = 1; $i <= $count_langs; $i++) {
    if($i == $langcount) $selects .= '<option value="'.$i.'" selected="selected">'.$i.'</option>';
    else $selects .= '<option value="'.$i.'">'.$i.'</option>';
  }

  $link1=getinput($ds['link1']);
  $link2=getinput($ds['link2']);
  $link3=getinput($ds['link3']);
  $link4=getinput($ds['link4']);

  $url1="http://";
  $url2="http://";
  $url3="http://";
  $url4="http://";

  if($ds['url1']!="http://") $url1=$ds['url1'];
  if($ds['url2']!="http://") $url2=$ds['url2'];
  if($ds['url3']!="http://") $url3=$ds['url3'];
  if($ds['url4']!="http://") $url4=$ds['url4'];

  if($ds['window1']){
    $window1_new = 'checked="checked"';
    $window1_self = '';
  }
  else{
    $window1_new = '';
    $window1_self = 'checked="checked"';
  }
  if($ds['window2']){
    $window2_new = 'checked="checked"';
    $window2_self = '';
  }
  else{
    $window2_new = '';
    $window2_self = 'checked="checked"';
  }
  if($ds['window3']){
    $window3_new = 'checked="checked"';
    $window3_self = '';
  }
  else{
    $window3_new = '';
    $window3_self = 'checked="checked"';
  }
  if($ds['window4']){
    $window4_new = 'checked="checked"';
    $window4_self = '';
  }
  else{
    $window4_new = '';
    $window4_self = 'checked="checked"';
  }

  $comments='<option value="0">'.$_language->module['no_comments'].'</option><option value="1">'.$_language->module['user_comments'].'</option><option value="2">'.$_language->module['visitor_comments'].'</option>';
  $comments=str_replace('value="'.$ds['comments'].'"', 'value="'.$ds['comments'].'" selected="selected"', $comments);

  $bg1=BG_1;

  eval ("\$addbbcode = \"".gettemplate("addbbcode")."\";");
  eval ("\$addflags = \"".gettemplate("flags")."\";");

  eval ("\$news_post = \"".gettemplate("news_post")."\";");
  echo $news_post;
}
elseif(basename($_SERVER['PHP_SELF'])=="news.php"){
  generate_rss2();
  header("Location: index.php?site=news");
}
elseif($action=="unpublished") {
  $_language->read_module('news');
 
  eval ("\$title_news = \"".gettemplate("title_news")."\";");
  echo $title_news;

  if(isnewsadmin($userID)) $post='<input type="button" onclick="MM_openBrWindow(\'news.php?action=new\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\');" value="'.$_language->module['post_news'].'" />';

  echo $post.' <input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=news\');return document.MM_returnValue;" value="'.$_language->module['show_news'].'" /><hr />';

  $page='';

  // Not published News
  if(isnewsadmin($userID)) {
    $ergebnis=safe_query("SELECT * FROM ".PREFIX."news WHERE published='0' AND saved='1' ORDER BY date ASC");
    if(mysql_num_rows($ergebnis)) {
      echo $_language->module['title_unpublished_news'];

      echo '<form method="post" name="form" action="news.php">';
      eval ("\$news_unpublished_head = \"".gettemplate("news_unpublished_head")."\";");
      echo $news_unpublished_head;

      $i=1;
      while($ds=mysql_fetch_array($ergebnis)) {
        if($i%2) {
          $bg1=BG_1;
          $bg2=BG_2;
        }
        else {
          $bg1=BG_3;
          $bg2=BG_4;
        }

        $date=date("d.m.Y", $ds['date']);
        $rubric=getrubricname($ds['rubric']);
        if(!isset($rubric)) $rubric='';
        $comms = getanzcomments($ds['newsID'], 'ne');
        $message_array = array();
        $query=safe_query("SELECT * FROM ".PREFIX."news_contents WHERE newsID='".$ds['newsID']."'");
        while($qs = mysql_fetch_array($query)) {
          $message_array[] = array('lang' => $qs['language'], 'headline' => $qs['headline'], 'message' => $qs['content']);
        }
       
        if($ds['type'] == 1) $typen = $_language->module['scene_news'];
          else $typen = $_language->module['news'];
       
        $headlines='';
       
        foreach($message_array as $val) {
          $headlines.=htmloutput('<a href="index.php?site=news_comments&amp;newsID='.$ds['newsID'].'&amp;lang='.$val['lang'].'">'.$val['lang'].' '.$val['headline'].'</a><br />');
        }

        $poster='<a href="index.php?site=profile&amp;id='.$ds['poster'].'">'.getnickname($ds['poster']).'</a>';

        $multiple='';
        $admdel='';
        if(isnewsadmin($userID)) {
          $multiple='<input class="input" type="checkbox" name="newsID[]" value="'.$ds['newsID'].'" />';
          $admdel='<table width="100%" border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td><input class="input" type="checkbox" name="ALL" value="ALL" onclick="SelectAll(this.form);" /> '.$_language->module['select_all'].'</td>
              <td align="right"><select name="quickactiontype">
                <option value="publish">'.$_language->module['publish_selected'].'</option>
                <option value="delete">'.$_language->module['delete_selected'].'</option>
              </select>
              <input type="submit" name="quickaction" value="'.$_language->module['go'].'" /></td>
            </tr>
          </table>
          </form>';

        }
        eval ("\$news_archive_content = \"".gettemplate("news_archive_content")."\";");
        echo $news_archive_content;
        $i++;
      }
      eval ("\$news_archive_foot = \"".gettemplate("news_archive_foot")."\";");
      echo $news_archive_foot;

      unset($ds);
    }
  }
}
elseif($action=="archive") {

  $_language->read_module('news');
 
  eval ("\$title_news = \"".gettemplate("title_news")."\";");
  echo $title_news;

  if(isset($_GET['page'])) $page=(int)$_GET['page'];
  else $page = 1;
  $sort="date";
  if(isset($_GET['sort'])){
    if(($_GET['sort']=='date') || ($_GET['sort']=='poster') || ($_GET['sort']=='rubric')) $sort=$_GET['sort'];
  }
 
  $type="DESC";
  if(isset($_GET['type'])){
    if(($_GET['type']=='ASC') || ($_GET['type']=='DESC')) $type=$_GET['type'];
  }
 
  $post='';
  $publish='';
  if(isnewsadmin($userID)) {
    $post='<input type="button" onclick="MM_openBrWindow(\'news.php?action=new\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\')" value="'.$_language->module['post_news'].'" />';
    $unpublished=safe_query("SELECT newsID FROM ".PREFIX."news WHERE published='0' AND saved='1'");
    $unpublished=mysql_num_rows($unpublished);
    if($unpublished) $publish='<input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=news&amp;action=unpublished\');return document.MM_returnValue" value="'.$unpublished.' '.$_language->module['unpublished_news'].'" /> ';
  }
  echo $post.' '.$publish.' <input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=news\');return document.MM_returnValue" value="'.$_language->module['show_news'].'" /><hr />';

  $all=safe_query("SELECT newsID FROM ".PREFIX."news WHERE published='1' AND intern<=".isclanmember($userID));
  $gesamt=mysql_num_rows($all);
  $pages=1;

  $max = empty($maxnewsarchiv) ? 20 : $maxnewsarchiv;
  $pages = ceil($gesamt/$max);

  if($pages>1) $page_link = makepagelink("index.php?site=news&amp;action=archive&amp;sort=".$sort."&amp;type=".$type, $page, $pages);
  else $page_link='';

  if($page == "1") {
    $ergebnis = safe_query("SELECT * FROM ".PREFIX."news WHERE published='1' AND intern<=".isclanmember($userID)." ORDER BY ".$sort." ".$type." LIMIT 0,".$max);
    if($type=="DESC") $n=$gesamt;
    else $n=1;
  }
  else {
    $start=$page*$max-$max;
    $ergebnis = safe_query("SELECT * FROM ".PREFIX."news WHERE published='1' AND intern<=".isclanmember($userID)." ORDER BY ".$sort." ".$type." LIMIT ".$start.",".$max);
    if($type=="DESC") $n = ($gesamt)-$page*$max+$max;
    else $n = ($gesamt+1)-$page*$max+$max;
  }
  if($all) {
    if($type=="ASC")
    echo'<a href="index.php?site=news&amp;action=archive&amp;page='.$page.'&amp;sort='.$sort.'&amp;type=DESC">'.$_language->module['sort'].'</a> <img src="images/icons/asc.gif" width="9" height="7"  alt="" />&nbsp;&nbsp;&nbsp;';
    else
    echo'<a href="index.php?site=news&amp;action=archive&amp;page='.$page.'&amp;sort='.$sort.'&amp;type=ASC">'.$_language->module['sort'].'</a> <img src="images/icons/desc.gif" width="9" height="7" alt="" />&nbsp;&nbsp;&nbsp;';


    if($pages>1) echo $page_link;
    if(isnewsadmin($userID)) echo'<form method="post" name="form" action="news.php">';
   
    eval ("\$news_archive_head = \"".gettemplate("news_archive_head")."\";");
    echo $news_archive_head;
   
    $i=1;
    while($ds=mysql_fetch_array($ergebnis)) {
      if($i%2) {
        $bg1=BG_1;
        $bg2=BG_2;
      }
      else {
        $bg1=BG_3;
        $bg2=BG_4;
      }

      $date=date("d.m.Y", $ds['date']);
      $rubric=getrubricname($ds['rubric']);
      $comms = getanzcomments($ds['newsID'], 'ne');
        if($ds['intern'] == 1) $isintern = '<small>('.$_language->module['intern'].')</small>';
        else $isintern = '';
     
      if($ds['type'] == 1) $typen = $_language->module['scene_news'];
        else $typen = $_language->module['news'];
     
      $message_array = array();
      $query=safe_query("SELECT * FROM ".PREFIX."news_contents WHERE newsID='".$ds['newsID']."'");
      while($qs = mysql_fetch_array($query)) {
        $message_array[] = array('lang' => $qs['language'], 'headline' => $qs['headline'], 'message' => $qs['content']);
      }

      $headlines='';

      foreach($message_array as $val) {
        $headlines.='<a href="index.php?site=news_comments&amp;newsID='.$ds['newsID'].'&amp;lang='.$val['lang'].'">'.$val['lang'].' '.$val['headline'].'</a> '.$isintern.'<br />';
      }
      $headlines = htmloutput($headlines);

      $poster='<a href="index.php?site=profile&amp;id='.$ds['poster'].'">'.getnickname($ds['poster']).'</a>';

      $multiple='';
      $admdel='';
      if(isnewsadmin($userID)) $multiple='<input class="input" type="checkbox" name="newsID[]" value="'.$ds['newsID'].'" />';

      eval ("\$news_archive_content = \"".gettemplate("news_archive_content")."\";");
      echo $news_archive_content;
      $i++;
    }
   
    if(isnewsadmin($userID)) $admdel='<table width="100%" border="0" cellspacing="0" cellpadding="2">
      <tr>
        <td><input class="input" type="checkbox" name="ALL" value="ALL" onclick="SelectAll(this.form);" /> '.$_language->module['select_all'].'</td>
        <td align="right"><select name="quickactiontype">
          <option value="delete">'.$_language->module['delete_selected'].'</option>
          <option value="unpublish">'.$_language->module['unpublish_selected'].'</option>
        </select>
        <input type="submit" name="quickaction" value="'.$_language->module['go'].'" /></td>
      </tr>
    </table>
    </form>';
    else $admdel='';

    eval ("\$news_archive_foot = \"".gettemplate("news_archive_foot")."\";");
    echo $news_archive_foot;
    unset($ds);

  }
  else echo'no entries';
}
/*
##############################################################
SCENE NEWS by kode-designs.com
##############################################################
*/
elseif($action=="scene") {
  $_language->read_module('news');
 
  eval ("\$title_scene_news = \"".gettemplate("title_scene_news")."\";");
  echo $title_scene_news;

  $post='';
  $publish='';
  if(isnewswriter($userID)) {
    $post='<input type="button" onclick="MM_openBrWindow(\'news.php?action=new\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\');" value="'.$_language->module['post_news'].'" />';
  }
  if(isnewsadmin($userID)) {
    $unpublished=safe_query("SELECT newsID FROM ".PREFIX."news WHERE published='0' AND saved='1'");
    $unpublished=mysql_num_rows($unpublished);
    if($unpublished) $publish='<input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=news&amp;action=unpublished\');return document.MM_returnValue;" value="'.$unpublished.' '.$_language->module['unpublished_news'].'" /> ';
  }
  echo $post.' '.$publish.'<input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=news&amp;action=archive\');return document.MM_returnValue;" value="'.$_language->module['news_archive'].'" /><hr />';

  if(isset($_GET['show'])) {
    $result=safe_query("SELECT rubricID FROM ".PREFIX."news_rubrics WHERE rubric='".$_GET['show']."' LIMIT 0,1");
    $dv=mysql_fetch_array($result);
    $showonly = "AND rubric='".$dv['rubricID']."'";
  }
  else $showonly = '';

  $result=safe_query("SELECT * FROM ".PREFIX."news WHERE published='1' AND type='1' AND intern<=".isclanmember($userID)." ".$showonly." ORDER BY date DESC LIMIT 0,".$maxshownnews);

  $i=1;
  while($ds=mysql_fetch_array($result)) {
    if($i%2) $bg1=BG_1;
    else $bg1=BG_2;

    $date = date("d.m.Y", $ds['date']);
    $time = date("H:i", $ds['date']);
    $rubrikname = getrubricname($ds['rubric']);
    $rubrikname_link = getinput($rubrikname);
    $rubricpic_path = "images/news-rubrics/".getrubricpic($ds['rubric']);
    $rubricpic='<img src="'.$rubricpic_path.'" alt="" />';
    if(!is_file($rubricpic_path)) $rubricpic='';

    $message_array = array();
    $query=safe_query("SELECT * FROM ".PREFIX."news_contents WHERE newsID='".$ds['newsID']."'");
    while($qs = mysql_fetch_array($query)) {
      $message_array[] = array('lang' => $qs['language'], 'headline' => $qs['headline'], 'message' => $qs['content']);
    }

    $showlang = select_language($message_array);

    $langs='';
    $i=0;
    foreach($message_array as $val) {
      if($showlang!=$i) $langs.='<span style="padding-left:2px"><a href="index.php?site=news_comments&amp;newsID='.$ds['newsID'].'&amp;lang='.$val['lang'].'">'.$val['lang'].'</a></span>';
      $i++;
    }
    $langs = flags($langs);

    $headline=$message_array[$showlang]['headline'];
    $content=$message_array[$showlang]['message'];
    $newsID=$ds['newsID'];
    if($ds['intern'] == 1) $isintern = '('.$_language->module['intern'].')';
    else $isintern = '';
   
    $content = htmloutput($content);
    $content = toggle($content, $ds['newsID']);
    $headline = clearfromtags($headline);
    $poster='<a href="index.php?site=profile&amp;id='.$ds['poster'].'"><b>'.getnickname($ds['poster']).'</b></a>';
    $related="";
    if($ds['link1'] && $ds['url1']!="http://" && $ds['window1']) $related.='&#8226; <a href="'.$ds['url1'].'" target="_blank">'.$ds['link1'].'</a> ';
    if($ds['link1'] && $ds['url1']!="http://" && !$ds['window1']) $related.='&#8226; <a href="'.$ds['url1'].'">'.$ds['link1'].'</a> ';

    if($ds['link2'] && $ds['url2']!="http://" && $ds['window2']) $related.='&#8226; <a href="'.$ds['url2'].'" target="_blank">'.$ds['link2'].'</a> ';
    if($ds['link2'] && $ds['url2']!="http://" && !$ds['window2']) $related.='&#8226; <a href="'.$ds['url2'].'">'.$ds['link2'].'</a> ';

    if($ds['link3'] && $ds['url3']!="http://" && $ds['window3']) $related.='&#8226; <a href="'.$ds['url3'].'" target="_blank">'.$ds['link3'].'</a> ';
    if($ds['link3'] && $ds['url3']!="http://" && !$ds['window3']) $related.='&#8226; <a href="'.$ds['url3'].'">'.$ds['link3'].'</a> ';

    if($ds['link4'] && $ds['url4']!="http://" && $ds['window4']) $related.='&#8226; <a href="'.$ds['url4'].'" target="_blank">'.$ds['link4'].'</a> ';
    if($ds['link4'] && $ds['url4']!="http://" && !$ds['window4']) $related.='&#8226; <a href="'.$ds['url4'].'">'.$ds['link4'].'</a> ';

    if(empty($related)) $related="n/a";

    if($ds['comments']) {
      if($ds['cwID']) {
        $anzcomments = getanzcomments($ds['cwID'], 'cw');
        $replace = Array('$anzcomments', '$url', '$lastposter', '$lastdate');
        $vars = Array($anzcomments, 'index.php?site=clanwars_details&amp;cwID='.$ds['cwID'], clearfromtags(getlastcommentposter($ds['cwID'], 'cw')), date('d.m.Y - H:i', getlastcommentdate($ds['cwID'], 'cw')));

        switch($anzcomments) {
          case 0: $comments = str_replace($replace, $vars, $_language->module['no_comment']); break;
          case 1: $comments = str_replace($replace, $vars, $_language->module['comment']); break;
          default: $comments = str_replace($replace, $vars, $_language->module['comments']); break;
        }
      }
      else {
        $anzcomments = getanzcomments($ds['newsID'], 'ne');
        $replace = Array('$anzcomments', '$url', '$lastposter', '$lastdate');
        $vars = Array($anzcomments, 'index.php?site=news_comments&amp;newsID='.$ds['newsID'], clearfromtags(html_entity_decode(getlastcommentposter($ds['newsID'], 'ne'))), date('d.m.Y - H:i', getlastcommentdate($ds['newsID'], 'ne')));

        switch($anzcomments) {
          case 0: $comments = str_replace($replace, $vars, $_language->module['no_comment']); break;
          case 1: $comments = str_replace($replace, $vars, $_language->module['comment']); break;
          default: $comments = str_replace($replace, $vars, $_language->module['comments']); break;
        }
      }
    }
    else $comments='';

    $adminaction = '';
    if(isnewsadmin($userID)) {
      $adminaction .= '<input type="button" onclick="MM_goToURL(\'parent\',\'news.php?quickactiontype=unpublish&amp;newsID='.$ds['newsID'].'\');return document.MM_returnValue;" value="'.$_language->module['unpublish'].'" /> ';
    }
    if((isnewswriter($userID) and $ds['poster'] == $userID) or isnewsadmin($userID)) {
      $adminaction .= '<input type="button" onclick="MM_openBrWindow(\'news.php?action=edit&amp;newsID='.$ds['newsID'].'\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\');" value="'.$_language->module['edit'].'" />
      <input type="button" onclick="MM_confirm(\''.$_language->module['really_delete'].'\', \'news.php?action=delete&amp;id='.$ds['newsID'].'\')" value="'.$_language->module['delete'].'" />';
    }

    eval ("\$news = \"".gettemplate("news")."\";");
    echo $news;

    $i++;

    unset($related);
    unset($comments);
    unset($lang);
    unset($ds);
  }
}
/*
##############################################################
SCENE END by kode-designs.com
##############################################################
*/
else {
  $_language->read_module('news');
 
  eval ("\$title_news = \"".gettemplate("title_news")."\";");
  echo $title_news;

  $post='';
  $publish='';
  if(isnewswriter($userID)) {
    $post='<input type="button" onclick="MM_openBrWindow(\'news.php?action=new\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\');" value="'.$_language->module['post_news'].'" />';
  }
  if(isnewsadmin($userID)) {
    $unpublished=safe_query("SELECT newsID FROM ".PREFIX."news WHERE published='0' AND saved='1'");
    $unpublished=mysql_num_rows($unpublished);
    if($unpublished) $publish='<input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=news&amp;action=unpublished\');return document.MM_returnValue;" value="'.$unpublished.' '.$_language->module['unpublished_news'].'" /> ';
  }
  echo $post.' '.$publish.'<input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=news&amp;action=archive\');return document.MM_returnValue;" value="'.$_language->module['news_archive'].'" /><hr />';

  if(isset($_GET['show'])) {
    $result=safe_query("SELECT rubricID FROM ".PREFIX."news_rubrics WHERE rubric='".$_GET['show']."' LIMIT 0,1");
    $dv=mysql_fetch_array($result);
    $showonly = "AND rubric='".$dv['rubricID']."'";
  }
  else $showonly = '';

  $result=safe_query("SELECT * FROM ".PREFIX."news WHERE published='1' AND type='0' AND intern<=".isclanmember($userID)." ".$showonly." ORDER BY date DESC LIMIT 0,".$maxshownnews);

  $i=1;
  $count = 1;
  while($ds=mysql_fetch_array($result)) {
    if($i%2) $bg1=BG_1;
    else $bg1=BG_2;

    $date = date("d.m.Y", $ds['date']);
    $time = date("H:i", $ds['date']);
    $rubrikname = getrubricname($ds['rubric']);
    $rubrikname_link = getinput($rubrikname);
    $rubricpic_path = "images/news-rubrics/".getrubricpic($ds['rubric']);
    $rubricpic='<img src="'.$rubricpic_path.'" alt="" />';
    if(!is_file($rubricpic_path)) $rubricpic='';

    $message_array = array();
    $query=safe_query("SELECT * FROM ".PREFIX."news_contents WHERE newsID='".$ds['newsID']."'");
    while($qs = mysql_fetch_array($query)) {
      $message_array[] = array('lang' => $qs['language'], 'headline' => $qs['headline'], 'message' => $qs['content']);
    }

    $showlang = select_language($message_array);

    $langs='';
    $i=0;
    foreach($message_array as $val) {
      if($showlang!=$i) $langs.='<span style="padding-left:2px"><a href="index.php?site=news_comments&amp;newsID='.$ds['newsID'].'&amp;lang='.$val['lang'].'">'.$val['lang'].'</a></span>';
      $i++;
    }
    $langs = flags($langs);

    $headline=$message_array[$showlang]['headline'];
    $content=$message_array[$showlang]['message'];
    $newsID=$ds['newsID'];
    if($ds['intern'] == 1) $isintern = '('.$_language->module['intern'].')';
    else $isintern = '';
   
    $content = htmloutput($content);
    $content = toggle($content, $ds['newsID']);
    $headline = clearfromtags($headline);
    $poster='<a href="index.php?site=profile&amp;id='.$ds['poster'].'"><b>'.getnickname($ds['poster']).'</b></a>';
    $anzforumtopics = mysql_num_rows(mysql_query("SELECT * FROM ".PREFIX."forum_topics WHERE userID = '".$ds['poster']."'"));
    $anznews = mysql_num_rows(mysql_query("SELECT newsID FROM ".PREFIX."news WHERE published='1' AND saved='1' AND poster = '".$ds['poster']."'"));
    $avatar='<img src="images/avatars/'.getavatar($userID).'" alt="" class="creditsava" />';
   
    $related="";
    if($ds['link1'] && $ds['url1']!="http://" && $ds['window1']) $related.='&#8226; <a href="'.$ds['url1'].'" target="_blank">'.$ds['link1'].'</a> ';
    if($ds['link1'] && $ds['url1']!="http://" && !$ds['window1']) $related.='&#8226; <a href="'.$ds['url1'].'">'.$ds['link1'].'</a> ';

    if($ds['link2'] && $ds['url2']!="http://" && $ds['window2']) $related.='&#8226; <a href="'.$ds['url2'].'" target="_blank">'.$ds['link2'].'</a> ';
    if($ds['link2'] && $ds['url2']!="http://" && !$ds['window2']) $related.='&#8226; <a href="'.$ds['url2'].'">'.$ds['link2'].'</a> ';

    if($ds['link3'] && $ds['url3']!="http://" && $ds['window3']) $related.='&#8226; <a href="'.$ds['url3'].'" target="_blank">'.$ds['link3'].'</a> ';
    if($ds['link3'] && $ds['url3']!="http://" && !$ds['window3']) $related.='&#8226; <a href="'.$ds['url3'].'">'.$ds['link3'].'</a> ';

    if($ds['link4'] && $ds['url4']!="http://" && $ds['window4']) $related.='&#8226; <a href="'.$ds['url4'].'" target="_blank">'.$ds['link4'].'</a> ';
    if($ds['link4'] && $ds['url4']!="http://" && !$ds['window4']) $related.='&#8226; <a href="'.$ds['url4'].'">'.$ds['link4'].'</a> ';

    if(empty($related)) $related="";

    if($ds['comments']) {
      if($ds['cwID']) {  // CLANWAR-NEWS
        $anzcomments = getanzcomments($ds['cwID'], 'cw');
        $replace = Array('$anzcomments', '$url', '$lastposter', '$lastdate');
        $vars = Array($anzcomments, 'index.php?site=clanwars_details&amp;cwID='.$ds['cwID'], clearfromtags(getlastcommentposter($ds['cwID'], 'cw')), date('d.m.Y - H:i', getlastcommentdate($ds['cwID'], 'cw')));

        switch($anzcomments) {
          case 0: $comments = str_replace($replace, $vars, $_language->module['no_comment']); break;
          case 1: $comments = str_replace($replace, $vars, $_language->module['comment']); break;
          default: $comments = str_replace($replace, $vars, $_language->module['comments']); break;
        }
      }
      else {
        $anzcomments = getanzcomments($ds['newsID'], 'ne');
        $replace = Array('$anzcomments', '$url', '$lastposter', '$lastdate');
        $vars = Array($anzcomments, 'index.php?site=news_comments&amp;newsID='.$ds['newsID'], clearfromtags(html_entity_decode(getlastcommentposter($ds['newsID'], 'ne'))), date('d.m.Y - H:i', getlastcommentdate($ds['newsID'], 'ne')));

        switch($anzcomments) {
          case 0: $comments = str_replace($replace, $vars, $_language->module['no_comment']); break;
          case 1: $comments = str_replace($replace, $vars, $_language->module['comment']); break;
          default: $comments = str_replace($replace, $vars, $_language->module['comments']); break;
        }
      }
    }
    else $comments='';

    $adminaction = '';
    if(isnewsadmin($userID)) {
      $adminaction .= '<input type="button" onclick="MM_goToURL(\'parent\',\'news.php?quickactiontype=unpublish&amp;newsID='.$ds['newsID'].'\');return document.MM_returnValue;" value="'.$_language->module['unpublish'].'" /> ';
    }
    if((isnewswriter($userID) and $ds['poster'] == $userID) or isnewsadmin($userID)) {
      $adminaction .= '<input type="button" onclick="MM_openBrWindow(\'news.php?action=edit&amp;newsID='.$ds['newsID'].'\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\');" value="'.$_language->module['edit'].'" />
      <input type="button" onclick="MM_confirm(\''.$_language->module['really_delete'].'\', \'news.php?action=delete&amp;id='.$ds['newsID'].'\')" value="'.$_language->module['delete'].'" />';
    }

    eval ("\$news = \"".gettemplate("news")."\";");
    echo $news;
    if($count == 1) {
      $allbanner = safe_query("SELECT * FROM ".PREFIX."bannerrotation WHERE displayed='1' ORDER BY RAND() LIMIT 0,1");
      $banner = mysql_fetch_array($allbanner);
      if(true) {
        echo '<div id="bannerrotation">
          <a href="out.php?bannerID='.$banner['bannerID'].'" target="_blank">
            <img src="./images/bannerrotation/'.$banner['banner'].'" alt ="'.htmlspecialchars($banner['bannername']).'" />
          </a>
        </div><!-- #bannerrotation -->';
      }
    }
    $i++;
    $count++;

    unset($related);
    unset($comments);
    unset($lang);
    unset($ds);
  }
}
?>



Was muss ich verbessern?


Problem 2: Matchviewer stellt Matches falsch dar.

Da suche ich momentan eine geeignete Alternative für den bisherigen Matchviewer. Dieser ist relativ unpraktisch in der Darstellung (siehe "Latest"). Was könnt ihr mir da empfehlen?
 
23.05.2012, 13:15 - Argu - webSPELL friend - 617 Posts
Vorweg, du hast keine Seite angegeben. In dem Sinne kann man nicht ganz nachvollziehen, was Problem 2 betrifft. Problem 1 ist schnell gelöst, lies dir einfach folgendes Tutorial durch

http://weseo.de/blog/read-more



[URL=http://www.2one-designs.de]2One-Designs.de - Free Templates, Webspell Coding, Addons und mehr![/URL]

 
23.05.2012, 16:19 - Bonk - webSPELL newbie - 12 Posts
www.mysterious-monkeys.de
 
29.05.2012, 18:47 - Bonk - webSPELL newbie - 12 Posts
kennt vielleicht jemand das problem mit unserem matchviewer? würde es sehr gerne ändern unglücklich
 
29.05.2012, 19:45 - Philipp - Administrator - 2566 Posts
Ich verstehe nicht das Problem beim Matchviewer. Könntest du es zumindest mal erklären, was deiner Meinung nach nicht stimmt
 
10.06.2012, 22:22 - Bonk - webSPELL newbie - 12 Posts
Hier mein Problem zu sehen:
http://im.bilderkiste.org/9133935863752/matchviewer.png

Der Matchviewer zieht sich immer den falschen Namen aus der Datenbank - in unserem Fall immer "Mysterious Monkeys Community". Noch dazu hat der Seitencode noch eine Topmatch anzeige. Die funktioniert aber auch nur halbherzig...

Wir würden deshalb den Bereich gerne komplett abändern. Eine gute Richtung wäre:
http://im.bilderkiste.org/0133935966447/gutes_beispiel.png

Nur brauche ich da definitiv Hilfe von euch. Was kann ich tun?