Contentteller

Contentteller Support Forums
Home Forums > Contentteller > Version 1.x >

How to add latest forum topics in a block on the Front Page ?

Discussion in 'Version 1.x' started by DSF2, Jan 30, 2006.

  1. DSF2 Guest

    How to add latest forum topics in a block on the Front Page ?

    Thank You !
    DSF2, Jan 30, 2006
    #1
  2. Philipp Guest

    How to add latest forum topics in a block on the Front Page ?

    To enable forums topics in a news block you need to configure the news block in cadmin => Other/Websites => NEWS BLOCKS (HEADER) or NEWS BLOCKS (FOOTER)

    Then select under "Block" the option "Forums (latest)". In case you are using a third party forum such as vBulletin, you need to select the option "bbwrapper" instead.
    Philipp, Jan 30, 2006
    #2
  3. DSF2 Guest

    How to add latest forum topics in a block on the Front Page ?

    Thanx , Can i put this block on the left or right side ?
    DSF2, Jan 30, 2006
    #3
  4. DSF2 Guest

    How to add latest forum topics in a block on the Front Page ?

    And allso i want ot know if its possible to make a block with a chart of the most read stories?
    DSF2, Jan 30, 2006
    #4
  5. Philipp Guest

    How to add latest forum topics in a block on the Front Page ?

    Thanx , Can i put this block on the left or right side ?
    Open the template site_header in the template editor and add after:

    Code:
    global $insert;
    the following:

    Code:
    $forums_data = "";
    dbconnect();
    $result = DBQuery("SELECT * FROM esselbach_st_forumsthreads t, esselbach_st_forums f WHERE f.forum_status = '1' AND t.thread_forum = f.forum_id ORDER BY t.thread_endtime DESC LIMIT 10");
    while ($data = mysql_fetch_array($result))
    {
    $forums_data .= "<li><a href="thread.php?id=".$data['thread_id']."">".htmlentities($data['thread_topic'])."</a></li>";
    }
    and add in the HTML part of the template after:
    Code:
    								</font></td>
    							</tr>
    						</table>
    						</td>
    					</tr>
    				</table>
    				<br />
    a new block:
    Code:
    <table cellspacing="0" cellpadding="0" width="160" bgcolor="#000000" border="0">
    <tr>
    <td>
    <table cellspacing="1" cellpadding="3" width="100%" border="0">
    <tr>
    <td bgcolor="#009966">
    <font face="Verdana, Arial, sans-serif" color="#ffffff" size="2"><b>Latest Forum Topics</b></font></td>
    </tr>
    <tr>
    <td bgcolor="#ffffff"><font size="2">
    $forums_data
    </font></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <br />    
    And allso i want ot know if its possible to make a block with a chart of the most read stories?
    1) Select News/Edit Fields in cadmin => Field 1 => "Enabled, text only" and add "Counter" as Field Text
    2) Open story.php in an editor and find:

    Code:
    HeaderBlock();
    Then add after this line the following:

    Code:
    dbconnect();
    DBQuery("UPDATE esselbach_st_stories SET extra_field1=extra_field1+ 1 WHERE story_id = '$id'");
    3) Open site_header in the template editor and add after:

    Code:
    global $insert;
    the following:

    Code:
    $stories_data = "";
    dbconnect();
    $result = DBQuery("SELECT * FROM esselbach_st_stories WHERE story_hook = '0' ORDER BY story_extra1 DESC LIMIT 10");
    while ($data = mysql_fetch_array($result))
    {
    $stories_data .= "<li><a href="story.php?id=".$data['story_id']."">".htmlentities($data['story_title'])."</a> (".$data['story_extra1']." views)</li>";
    }
    Then add a new block in the HTML part:

    Code:
    <table cellspacing="0" cellpadding="0" width="160" bgcolor="#000000" border="0">
    <tr>
    <td>
    <table cellspacing="1" cellpadding="3" width="100%" border="0">
    <tr>
    <td bgcolor="#009966">
    <font face="Verdana, Arial, sans-serif" color="#ffffff" size="2"><b>Top 10 Stories</b></font></td>
    </tr>
    <tr>
    <td bgcolor="#ffffff"><font size="2">
    $stories_data
    </font></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <br />    
    Philipp, Jan 31, 2006
    #5
  6. DSF2 Guest

    How to add latest forum topics in a block on the Front Page ?

    Ive got this err now

    Error: 1054 Unknown column 'extra_field2' in 'field list'

    when i try to open any story :(
    DSF2, Jan 31, 2006
    #6
  7. Philipp Guest

    How to add latest forum topics in a block on the Front Page ?

    Sorry, it should be:
    Code:
    DBQuery("UPDATE esselbach_st_stories SET story_field1=story_field1+1 WHERE story_id = '$id'");
    or in your case story_field2
    Philipp, Jan 31, 2006
    #7
  8. DSF2 Guest

    How to add latest forum topics in a block on the Front Page ?

    I managed to work , but it seems that doesnt count news posted this year ..only those from last year www.thehotfiles.com
    DSF2, Jan 31, 2006
    #8
  9. Philipp Guest

    How to add latest forum topics in a block on the Front Page ?

    It shouldn’t make any difference between news from this year and last year
    Philipp, Feb 1, 2006
    #9
  10. DSF2 Guest

    How to add latest forum topics in a block on the Front Page ?

    It only counts until 9 . Any tips ?

    Thank You
    DSF2, Feb 1, 2006
    #10
  11. Philipp Guest

    How to add latest forum topics in a block on the Front Page ?

    It seems like a problem with the code in the site_header template. Can you post the entire PHP part from that template?
    Philipp, Feb 2, 2006
    #11
  12. DSF2 Guest

    How to add latest forum topics in a block on the Front Page ?

    <?php
    global $insert;
    $stories_data = "";
    dbconnect();
    $result = DBQuery("SELECT * FROM esselbach_st_stories WHERE story_hook = '0' ORDER BY story_extra1 DESC LIMIT 10");
    while ($data = mysql_fetch_array($result))
    {
    $stories_data .= "<li><b><a href="story.php?id=".$data['story_id']."">".htmlentities($data['story_title'])."</a></b><br> (".$data['story_extra1']." downloads)</li>";
    }



    $EST_TEMPLATE = <<<TEMPLATE
    <!-- Template site_header -->

    <html>

    <head>
    <title>$insert[page_title]</title>

    <meta name="GENERATOR" content="Esselbach Storyteller CMS System - http://www.esselbach.com" />
    <meta name="KEYWORDS" content="$insert[page_keywords]" />
    <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
    <link rel="alternate" title="RSS news feed" href="$insert[site_url]/backend.php" type="application/rss+xml" />

    <style type="text/css">
    TD {
    FONT-SIZE: 10pt; FONT-FAMILY: Verdana,Arial,Helvetica
    }
    BODY {
    FONT-SIZE: 10pt; FONT-FAMILY: Verdana,Arial,Helvetica
    }
    </style>

    </head>

    <body text="#000000" vlink="#df1a1a" alink="#1555b5" link="#000000" bgcolor="#faad58" leftmargin="0" topmargin="5" rightmargin="0">

    <script language="JavaScript">
    <!--
    function FullWin(tag) {
    var newWinObj = window.open(tag,'newWin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=950,height=680')
    }
    function addNetscapePanel() {
    if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function"))
    {
    window.sidebar.addPanel ("$insert[site_name]", "$insert[site_url]/sidebar.php","");
    }
    else
    {
    var rv = window.confirm ("This page is enhanced for use with Mozilla. " + "Would you like to upgrade now?");
    if (rv)
    document.location.href = "http://www.mozilla.org";
    }
    }
    //-->
    </script>

    <table cellspacing="0" cellpadding="3" width="100%" align="center" bgcolor="#FFEBCD" border="0">
    <tr>
    <td>
    <table cellspacing="0" cellpadding="1" width="100%" bgcolor="#FFEBCD" border="0">
    <tr>
    <td>
    <table cellspacing="0" cellpadding="2" width="100%" bgcolor="#FFEBCD" border="0">
    <tr>
    <td>
    <a href="http://www.thehotfiles.com"><img src="images/logo.png" alt="TheHotFiles.com" border="0" /></a></a>








    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    <!--<tr bgcolor="#000000">
    <td bgcolor="#000080" colspan="2">
    <font face="Arial" color="#FFEBCD" size="2"><b>STORYTELLER CMS SYSTEM</b></font></td>
    </tr>-->
    <tr>
    <td valign="top" width="100%" bgcolor="#FFEBCD">
    <table cellspacing="0" cellpadding="2" width="100%" border="0">
    <tr>
    <td valign="top" width="160" bgcolor="#faad58">
    <table cellspacing="0" cellpadding="0" width="160" bgcolor="#faad58" border="0">
    <tr>
    <td>
    <table cellspacing="1" cellpadding="3" width="100%" border="0">
    <tr>
    <td bgcolor="#b71515">
    <font face="Arial" color="#FFEBCD" size="3"><b>Main Menu</b></font></td>
    </tr>
    <tr>
    <td bgcolor="#faad58"><font size="2">
    <li><a href="index.php"><b>Home Page</b></a><br /></li>
    <li><a href="category.php"><b>Files Categories</b></a><br /></li>
    <li><a href="archive.php"><b>File Archive</b></a><br /></li>
    <!--<li><a href="forums.php">Forums</a><br /></li>-->
    <li><b><a href="comments.php"><b>Comments</b></a><br /></li>
    <!--<li><a href="review.php">Reviews</a></li>-->
    <!--<li><a href="faq.php">FAQ</a><br /></li>-->
    <!--<li><a href="poll.php">Polls</a></li>-->
    <!--<li><a href="link.php">Web Links</a><br /></li>-->
    <li><a href="search.php"><font size="4"><b>Search Files</b></a></li></font>
    <li><a href="submitstory.php"><b>Submit Hot Files</b></a></li>
    <!--<li><a href="page.php">Pages</a></li>-->
    </font></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>

    <table cellspacing="0" cellpadding="0" width="160" bgcolor="#faad58" border="0">
    <tr>
    <td>
    <table cellspacing="1" cellpadding="3" width="100%" border="0">
    <tr>
    <td bgcolor="#b71515">
    <font face="Arial" color="#FFEBCD" size="3"><b>User</b></font></td>
    </tr>
    <tr>
    <td bgcolor="#faad58"><font size="2">
    <li><a href="register.php"><b>Register</b></a><br /></li>
    <li><a href="login.php"><b>Login</b></a><br /></li>
    <li><a href="logout.php"><b>Logout</b></a><br /></li>
    <li><a href="upanel.php"><b>Control Panel</b></a><br /></li>
    <li><a href="pm.php"><b>Private Messages</b></a></li>
    </font></td>
    </tr>
    </table>
    </td>
    </tr>
    </table><br>

    <center>
    <script type="text/javascript"><!--
    google_ad_client = "pub-6202451756762997";
    google_ad_width = 120;
    google_ad_height = 240;
    google_ad_format = "120x240_as_rimg";
    google_cpa_choice = "CAAQjeWZzgEaCGUPemYRwK8bKPG193M";
    //--></script>
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script></center><br>


    <!-- Blocul cu Top Stories -->
    <table cellspacing="0" cellpadding="0" width="160" bgcolor="#faad58" border="0">
    <tr>
    <td>
    <table cellspacing="1" cellpadding="3" width="100%" border="0">
    <tr>
    <td bgcolor="#b71515">
    <font face="Verdana, Arial, sans-serif" color="#FFEBCD" size="2"><b>Latest Downloads</b></font></td>
    </tr>
    <tr>
    <td bgcolor="#faad58"><font size="2">
    $stories_data
    </font></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <br />








    <table cellspacing="0" cellpadding="0" width="160" bgcolor="#faad58" border="0">
    <tr>
    <td>
    <table cellspacing="1" cellpadding="3" width="100%" border="0">
    <tr>
    <td bgcolor="#b71515">
    <font face="Arial" color="#FFEBCD" size="3"><b>News Feeds</b></font></td>
    </tr>
    <tr>
    <td bgcolor="#faad58"><font size="2">
    <li><a href="mobile.php">Handheld/PDA</a><br /></li>
    <li><a href="backend.php?action=help">XML News Feeds</a><br /></li>
    <li><a href="sidebar.php" target="_blank">View Sidebar</a><br /></li>
    <li><a href="javascript:addNetscapePanel();">Mozilla Sidebar</a><br /></li>

    <br>
    <br>


    </font></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>

    </td>








    <td>&nbsp; </td>
    <td valign="top" width="85%">
    $insert[login_header]

    TEMPLATE;
    ?>
    DSF2, Feb 2, 2006
    #12
  13. Philipp Guest

    How to add latest forum topics in a block on the Front Page ?

    Strange :(. Try changing the query to:

    Code:
    $result = DBQuery("SELECT * FROM esselbach_st_stories ORDER BY story_extra1 DESC LIMIT 10"); 
    Philipp, Feb 2, 2006
    #13
Show Ignored Content

Share This Page

Tweet
Forgot your password?
Contentteller Support Forums
Home Forums > Contentteller > Version 1.x >
  • Home
  • Forums

    Forums

    Quick Links
    • Search Forums
    • What's New?
  • Members

    Members

    Quick Links
    • Registered Members
    • Current Visitors
    • Recent Activity
  • Help

    Help

    Quick Links
    • Smilies
    • BB Codes
    • Trophies

Separate names with a comma.

Useful Searches

  • Recent Threads
More...
    Forum software by XenForo™ ©2010-2012 XenForo Ltd.