Avatar billede netzie Nybegynder
04. september 2003 - 18:16 Der er 3 kommentarer

Nyheds script i forum (Snitz)

Jeg driver et Snitz forum (Diskussions forum på nettet for en række selvstændige erhvervsdrivende)

I dette forum er der et "Nyheds modul" på engelsk som jeg er ved at undersøge om det er mulig at få på dansk, forstået på den måde at det er et lille ASP script der henter et par nyheds overskrifter fra en amerikansk nyhedsbureau som jo så får besøgende når folk klikker på deres link.

Findes der en sådan lille service / script så jeg kunne få danske nyheder i stedet for den amerikanske nyheds kanal?

Info: Snitz Forum 3.3.0.4
News Forum Refreshed v11

Her selve scriptet der skal includeres i Snitz forum.
Spørgsmålet er: Findes der nogle danske udbydere - det gør der sikkert! Men hvad og hvor og hvordan skriver jeg så dette script om så det passer og kan bruges. Med andre ord... Jeg giver 100 points for LØSNINGS-SCRIPTET ikke for kommentare :)

På forhånd tak

Netz
Avatar billede netzie Nybegynder
04. september 2003 - 18:19 #1
Her er så Scriptet:

<!-- Moreover.com News script for huws portal. -->
<!-- Instructions: include this file in the portal_content.asp file where you want the news to appear. -->
<!-- The script is one I had lying around, you can customise it as its fairly self explanatory.-->
<%

Response.Write  "<table width=""100%"" border=""0"" bordercolor=""" & strTableBorderColor & """ cellspacing=""1"" cellpadding=""0"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
        "<tr>" & vbNewLine & _
        "<td bgcolor=""" & StrHeadCellColor & """>" & vbNewLine & _
        "<font size=""4"" color=""" & StrHeadFontColor & """>&nbsp;Live News</font>" & vbNewLine & _
        "</td>" & vbNewLine & _
        "</tr>" & vbNewLine & _
        "<tr>" & vbNewLine & _
        "<td align=""left"">" & vbNewLine & _
        "<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
        "<tr>" & vbNewLine & _
        "<td>" & vbNewLine
%>
<div align="center"><center>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%" bgcolor="<%= strForumCellColor %>" cellspacing="0" cellpadding="0" valign="top">
<!-- Start Of Moreover.com News Javascript Code -->   
<script LANGUAGE="Javascript">
  <!--
  // the array global_article is used to allow multiple categories
  var global_article = new Array();
  var global_article_counter = 0;
  var article = null;
  var early_exit = 1;
  var moreover_text = 0;
  function load_wizard()
    {
   
    var newwin = window.open("","clone","resizable,scrollbars,width=500,height=590");
    document.forms.moreover_clone.submit();
    return true;
    }
 
  // -->
  </script>
  <script LANGUAGE="Javascript" SRC="http://p.moreover.com/cgi-local/page?o=js&amp;query=computer&amp;n=5">
  </script>
  <script LANGUAGE="Javascript">
  <!--
  // load global_article array with articles from category
  if (article != null)
    {
    early_exit = 0;

    for (var article_counter = 0; article_counter < Math.min(article.length,9); article_counter++)
      {
      global_article[global_article_counter] = article[article_counter];
      global_article[global_article_counter].url += "&w=555226";
      global_article[global_article_counter].url += "' TARGET='_blank";
      global_article[global_article_counter].document_url += "' TARGET='_blank";
      global_article_counter++;
      }


    }

  if (global_article.length == 0)
      {
      if (early_exit)
        {
        document.writeln("<CENTER>Offline, Live news not available. Please log on</CENTER>");
        }
      else
        {
        document.writeln("<CENTER>Sorry, no articles matched your search criteria</CENTER>");
        early_exit = 1;
        }
      }
  // -->
  </script>
  <script LANGUAGE="Javascript" SRC="http://p.moreover.com/dr/wizard_text.js"></script>
  <script LANGUAGE="Javascript">
  <!--
  if (!early_exit)
  {
  var webfeed_heading = "Technoloy";
  var width = "100%";
  var numberofarticles = 5;
  var item_spacing = "4";
  var cluster_bgcolor = '<%=StrForumCellColor%>';
  var cluster_border = "0";
  var heading_display = "Yes";
  var time_display = "Yes";
  var cell_spacing = "0";
  var cell_padding = "0";
  var heading_bgcolor = '<%=StrAltForumCellColor%>';
  var heading_font = '<%=StrDefaultFontFace%>';
  var heading_font_size = "-1";
  var heading_fgcolor = "FFFFFF";
  var headline_bgcolor = '<%=StrForumCellColor%>';
  var headline_font = '<%=StrDefaultFontFace%>';
  var headline_font_size = "-1";
  var headline_fgcolor = "FF9900";
  var source_font = '<%=StrDefaultFontFace%>';
  var source_font_size = "-2";
  var source_fgcolor = "CCCCCC";
  var access_font = '<%=StrDefaultFontFace%>';
  var access_font_size = "-2";
  var access_fgcolor = "BBBBBB";
  var time_font = '<%=StrDefaultFontFace%>';
  var time_font_size = "-2";
  var time_fgcolor = "000000";
  var time = new Array(global_article.length);

  // Print out the table containing the headlines
  document.writeln("<CENTER><TABLE BORDER="+cluster_border+" BGCOLOR='#"+cluster_bgcolor+"' WIDTH='"+width+"' CELLPADDING=2 CELLSPACING=0>");
  //document.writeln("<tr><td  align='center'><img src='http://i.moreover.com/images/moreover_wizard_link.gif' border='0'></td></tr>")
  document.writeln("<TR><TD><CENTER><TABLE BGCOLOR='#"+cluster_bgcolor+"' CELLPADDING="+cell_padding+" CELLSPACING="+cell_spacing+"  WIDTH='100%'>");

  if (heading_display == "Yes")
    {
    // Print a new category heading
    document.writeln("<TR BGCOLOR='#"+heading_bgcolor+"'><TD>");
    document.writeln("<FONT SIZE="+heading_font_size+" FACE="+heading_font+" COLOR='#"+heading_fgcolor+"'>");
    document.writeln("<B>"+webfeed_heading+"</B></FONT></TD></TR>");
    }

  // Start loop for articles
    for (var counter=0; counter < Math.min(numberofarticles,global_article.length); counter++)
    {
    if ((counter == (global_article.length - 1)) && moreover_text == 1)
      {
      headline_fgcolor = source_fgcolor;
      time_display = "No";
      }

    // Print out the headline
    document.writeln("<TR BGCOLOR='#"+headline_bgcolor+"'><TD><A HREF='"+global_article[counter].url+"' >");
    document.writeln("<FONT SIZE="+headline_font_size+" FACE="+headline_font+" COLOR='#"+headline_fgcolor+"'");
    document.writeln(">"+global_article[counter].headline_text+"...</FONT></A><br>");

   
      // Print out the source
        if ((counter != (global_article.length - 1)) || moreover_text != 1)
        {
        document.writeln("<A HREF='"+global_article[counter].document_url+"' >");
        document.writeln("<FONT FACE="+source_font+" SIZE="+source_font_size+" COLOR='#"+source_fgcolor+"'>");
        document.writeln(""+global_article[counter].source+"</FONT></A>&nbsp;&nbsp;");
        }
   

    // Print out reg/sub if appropriate
    if (global_article[counter].access_status == "sub" || global_article[counter].access_status == "reg")
      {
      document.writeln(" <A HREF='"+global_article[counter].access_registration+"'>");
      document.writeln("<FONT FACE="+access_font+" SIZE="+access_font_size);
      document.writeln(" COLOR='#"+access_fgcolor+"'>"+global_article[counter].access_status+"</FONT></A>&nbsp;&nbsp;");
      }


        // Print out the harvest time
    if (time_display == "Yes")
      {
      // Make a new date object
      time[counter] = new Date(global_article[counter].harvest_time);
      time[counter].setHours(time[counter].getHours() - (time[counter].getTimezoneOffset() / 60 ));
      document.writeln("<BR><FONT FACE="+time_font+" SIZE="+time_font_size+" COLOR='#"+time_fgcolor+"'>");
      document.writeln(""+time[counter].toString()+"</FONT>");
//      document.writeln(""+time[counter].toString()+"</FONT>");
      }



    document.writeln("</TD></TR><TR BGCOLOR='#"+headline_bgcolor+"'><TD BGCOLOR='#"+headline_bgcolor+"' HEIGHT="+item_spacing+"><br></TD></TR>");
    } // End of article loop

  // Start of clone button code //
  // NOTE: DO NOT REMOVE any of the code in this section //
  document.writeln("<FORM METHOD='POST' ACTION='http://www.moreover.com/cgi-local/wizard_clone.pl' target='clone' name='moreover_clone'>");
  document.writeln("<INPUT TYPE='hidden' NAME='parent_code' VALUE='555226'>");
  document.writeln("<INPUT TYPE='hidden' NAME='heading_font_size' VALUE='-1'><INPUT TYPE='hidden' NAME='source_font_size' VALUE='-2'>")
  document.writeln("<INPUT TYPE='hidden' NAME='cluster_width' VALUE='200'><INPUT TYPE='hidden' NAME='time_display' VALUE='Yes'>")
  document.writeln("<INPUT TYPE='hidden' NAME='time_font' VALUE='Arial,Helvetica, sans-serif'><INPUT TYPE='hidden' NAME='cluster_cellspacing' VALUE='0'>")
  document.writeln("<INPUT TYPE='hidden' NAME='heading_font' VALUE='Arial,Helvetica, sans-serif'><INPUT TYPE='hidden' NAME='number_of_headlines' VALUE='10'>")
  document.writeln("<INPUT TYPE='hidden' NAME='cluster_bgcolor' VALUE='FFFFFF'><INPUT TYPE='hidden' NAME='search_keywords' VALUE=''>")
  document.writeln("<INPUT TYPE='hidden' NAME='refine_category' VALUE=''><INPUT TYPE='hidden' NAME='time_fgcolor' VALUE='ff0000'>")
  document.writeln("<INPUT TYPE='hidden' NAME='access_fgcolor' VALUE='ff0000'><INPUT TYPE='hidden' NAME='time_font_size' VALUE='-2'>")
  document.writeln("<INPUT TYPE='hidden' NAME='headline_bgcolor' VALUE='FFFFFF'><INPUT TYPE='hidden' NAME='access_font_size' VALUE='-2'>")
  document.writeln("<INPUT TYPE='hidden' NAME='cluster_name' VALUE='c=US%20news&o=js'><INPUT TYPE='hidden' NAME='heading_display' VALUE='Yes'>")
  document.writeln("<INPUT TYPE='hidden' NAME='headline_fgcolor' VALUE='000000'><INPUT TYPE='hidden' NAME='source_font' VALUE='Arial,Helvetica, sans-serif'>")
  document.writeln("<INPUT TYPE='hidden' NAME='access_font' VALUE='Arial,Helvetica, sans-serif'><INPUT TYPE='hidden' NAME='headline_font_size' VALUE='-1'>")
  document.writeln("<INPUT TYPE='hidden' NAME='headline_font' VALUE='Arial,Helvetica, sans-serif'><INPUT TYPE='hidden' NAME='heading_bold' VALUE='Yes'>")
  document.writeln("<INPUT TYPE='hidden' NAME='item_spacing' VALUE='5'><INPUT TYPE='hidden' NAME='wizard_brand' VALUE='moreover_new'>")
  document.writeln("<INPUT TYPE='hidden' NAME='heading_bgcolor' VALUE='FFFFFF'><INPUT TYPE='hidden' NAME='cluster_cellpadding' VALUE='1'>")
  document.writeln("<INPUT TYPE='hidden' NAME='heading_fgcolor' VALUE='000000'><INPUT TYPE='hidden' NAME='source_fgcolor' VALUE='ff0000'>")
  document.writeln("<INPUT TYPE='hidden' NAME='cluster_border' VALUE='0'><INPUT TYPE='hidden' NAME='cluster_layout' VALUE='<br>'>")

  document.writeln("</FORM>");
  // End of clone button code //

  document.writeln("</FORM></TABLE></CENTER></TD></TR></TABLE></CENTER>");

  // ************************************************************************************
  // This code is subject to the copyright and warranty restrictions detailed at
  // http://www.moreover.com/wizard_copyright.html
  // Copyright 2000 Moreover.com Inc. All rights reserved.
  // *************************************************************************************
  }
  // -->
  </script>
  <a HREF="http://www.moreover.com">
  </a>
  <!-- End Of Moreover.com News Javascript Code -->
</td>
  </tr>
</table>
</div>
<%
Response.Write  "</td>" & vbNewLine & _
        "</tr>" & vbNewLine & _
        "</table>" & vbNewLine & _
        "</td>" & vbNewLine & _
        "</tr>" & vbNewLine & _
        "</table>" & vbNewLine
%>
Avatar billede d4s Novice
04. september 2003 - 21:38 #2
Eftersom det hele skal inkluderes på de sider, der skal vise nyhederne, foreslår jeg at du i stedet inkluderer et dansk nyhedssite. Der er mange at vælge mellem:

http://www.google.com/search?q=nyheder+p%C3%A5+din+side&hl=da&lr=&ie=UTF-8&oe=UTF-8&start=0&sa=N

Jeg vil ikke anbefale en side, da det er en smagssag om man vil have børsen eller bt.

Håber du kan bruge ideen.

D4
Avatar billede netzie Nybegynder
05. september 2003 - 11:50 #3
Hej D4,

Tak for kommentaren, jeg har kikket de fleste links igennem på Google - Det bedste bud var Webpressen.dk - Men de har et lille Javascript (som kan tilpasses i design) som jeg evt. kan implementerer med lidt snilde. Men det er ikke lige en løsning, da scripetet ser mere complext ud og kræver samarbejde med Snitz (The forum) men tak anyway.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester