WebProWorld
Dev Forum |
Script to keep website on 9 to 5 I am new to PHP and Java scripts.
I want to make my website available to members for a particular time.
php script - for ranking link exchanges? Is there any software out there that allows me to rank link exchanges?
Example: if Mike trades links with me, his site moves up in rankings each time some visits my site from his. Thanks
Link variable (PHP) I wondered if anyone could help me. I'm trying to open a new window set to a specific size and with no toolbars etc when clicked on a picture. I can open a new window using target="_blank" but when I put in the rest of the code it wont accept it:
|
|
|
|
Recent Articles |
Dominion Digital Senior Consultant Co-authors ASP.NET Cookbook Dominion Digital announced that senior consultant Michael Kittel has co-authored a book titled ASP.NET Cookbook with former company consultant Geoffrey LeBlond.
Urchin Releases ASP Web Analytics Software Urchin Software Corporation today released Urchin 6 On Demand, an ASP version of its popular web analytics and marketing intelligence software.
Go Daddy Hosting to Include ASP.NET Support The Go Daddy Group has updated its web site hosting plans with more storage, more monthly data transfer and more email account flexibility while expanding its offerings to include ASP.NET support.
10 Basic Requirements in Choosing a Good ASP Hosting Account In the world of internet application, solutions are greater than products. Individuals and companies are still investing in web technologies, but they are investing in solutions with demonstrated benefits.
Creating an Online RSS News Aggregator with ASP.NET Part 5 Displaying the Details for a Particular News Item All that remains left to do is to display the detailed information for the particular news item the user selected.
Creating an Online RSS News Aggregator with ASP.NET Part 4 Displaying the News Items for a Particular Syndication Feed The next task that faces us is creating the DisplayNewsItems.aspx Web page. This page should display the titles of the news items in the selected syndication feed as hyperlinks such that when the hyperlink is clicked the description of the news item is shown in the bottom right frame.
Creating an Online RSS News Aggregator with ASP.NET Part 3 Consuming a Syndication Feed in an ASP.NET Web Page In order to test the syndication engine we just created, let's build an online news aggregator that allows for any number of syndication feeds. The aggregator user interface will be fairly straightforward, comprising of three frames, as shown in Figure 2.
Creating an Online RSS News Aggregator with ASP.NET Part 2 Creating the Syndication Output via an ASP.NET Web Page Now that we've seen how our news items are stored along with the RSS 2.0 specification, we're ready to create an ASP.NET Web page that, when requested, will return our Web site's syndicated content. More specifically, we'll create an ASP.NET Web page named rss.aspx that will return the five most recent news items from the Articles database table, formatted according to the RSS 2.0 specification. |
|
|
|
10.08.04
Displaying The Details For A Particular News Item
By Scott Mitchell
This is Part 5 of a 5 part article "Creating An Online RSS News Aggregator With ASP.NET".
All that remains left to do is to display the detailed information for the particular news item the user selected. This detailed information will be displayed in the bottom right frame, and will show the title of the news item entry, its description, and a link to the news item. As with the DisplayNewsItem.aspx Web page, DisplayItem.aspx starts by retrieving the remote RSS syndication feed based on the passed-in FeedID querystring parameter. It then uses an XML Web control to display the detailed information. In fact, the Page_Load event handler for the DisplayItem.aspx Web page is identical to the DisplayNewsItem.aspx Web page's Page_Load event handler save for two minor differences:
DisplayItem.aspx needs to read in the value of the ID querystring parameter, and
DisplayItem.aspx uses an XSLT parameter, but one different from DisplayNewsItem.aspx.
As with DisplayNewsItem.aspx, DisplayItem.aspx needs to pass in a parameter into the XSLT stylesheet. Whereas DisplayNewsItem.aspx passed in the querystring parameter for FeedID, DisplayItem.aspx needs to pass in the ID querystring parameter, which indicates what news item the XSLT stylesheet should display. These minor changes are shown in the Page_Load event handler below in a bold font; code identical to the Page_Load event handler from DisplayNewsItems.aspx has been omitted:
private void Page_Load(object sender, System.EventArgs e)
{
  // See if the news items for this feed are in the Data Cache
  int feedID = Int32.Parse(Request.QueryString["FeedID"]);
  int ID = Int32.Parse(Request.QueryString["ID"]);
...
  // Now that we have the feed URL, load it in into an XML document
  XmlDocument feedXML = new XmlDocument();
  feedXML.Load(feedURL);
  xmlNewsItems.Document = feedXML;
  this.xmlItem.Document = feedXML;
  // Add the ID parameter to the XSLT stylesheet
  XsltArgumentList xsltArgList = new XsltArgumentList();
  xsltArgList.AddParam("ID", "", ID);
  xmlItem.TransformArgumentList = xsltArgList;}
Hosted service tracks 100's of real-time website statistics - 30 Day Trial |
|
The XSLT stylesheet to transform the XML data can be seen below:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" omit-xml-declaration="yes" />
  <xsl:param name="ID" />
  <xsl:template match="/rss/channel">
   <b><xsl:value-of select="item[$ID]/title"
       disable-output-escaping="yes" /></b>
   <p>
    <xsl:value-of select="item[$ID]/description"
       disable-output-escaping="yes" />
   </p>
   <a>
   <xsl:attribute name="href"><xsl:value-of
   select="item[$ID]/link" /></xsl:attribute>
    <xsl:attribute name="target">_blank</xsl:attribute>
    Read More...
   </a>
  </xsl:template>
</xsl:stylesheet>
Note that an <xsl:param> element is used to declare the ID XSLT parameter. Then, in the various <xsl:value-of> elements, the ID parameter is used to grab just the specific <item> element from the list of item elements. Realize that in XPath the syntax elementName[i] accesses just the Ith element with the appropriate element name. For example, item[1] would retrieve just the first <item> element, while item[2] would retrieve just the second. Therefore, item[$ID] retrieves just the <item> element as specified by the ID XSLT parameter.
Finally, note that the Read More… hyperlink, outputted near the end of the XSLT stylesheet, has its target attribute set to blank, thereby causing a new window to be opened when a user clicks on the Read More… link.
Read the Rest of the Article.
*This article originally appeared on the ASP.NET Dev Center at MSDN
About the Author: Scott Mitchell, author of five ASP/ASP.NET books and founder of 4GuysFromRolla.com, has been working with Microsoft Web technologies for the past five years. An active member in the ASP and ASP.NET community, Scott is passionate about ASP and ASP.NET and enjoys helping others learn more about these exciting technologies. For more on the DataGrid, DataList, and Repeater controls, check out Scott's book ASP.NET Data Web Controls Kick Start (ISBN: 0672325012). Read his blog at : http://scottonwriting.net |