Jump to content
WebFlake
  • 0

thread to homepage


derron

Question

Recommended Posts

  • 0

So do you know any php? 

The zipped forum comes with a folder called tools. In it is a program called ssi and a folder called ssi_templates. You can copy those to your forum folder and use that to create what you want.

If you do not know php code I will fix it. But if you do know any php try it yourself and I will help you finish it.

Link to comment
Share on other sites

  • 0

So do you know any php? 

The zipped forum comes with a folder called tools. In it is a program called ssi and a folder called ssi_templates. You can copy those to your forum folder and use that to create what you want.

If you do not know php code I will fix it. But if you do know any php try it yourself and I will help you finish it.

I have no .php knowledge

Link to comment
Share on other sites

  • 0

Where is the html for the display of the posts?

 

<div class="news">

<div class="sub_page_c">
<div id="spc_head"><p>Title Here</p></div>
<div id="spc_cont">
<div align="center" class="dot">
Description Here</a><br> <div align="right">
<font color="FFCC99">
Date Here </font>
</div>
</div>
</div>
</div>
<div class="sub_page_c">
<div id="spc_head"><p>Title Here</p></div>
<div id="spc_cont">
<div align="center" class="dot">
Description Here<br><br> <div align="right">
<font color="FFCC99">
Date Here </font>
</div>
</div>
</div>
</div>
<div class="sub_page_c">
<div id="spc_head"><p>Title Here</p></div>
<div id="spc_cont">
<div align="center" class="dot">
Description Here</a><br> <div align="right">
<font color="FFCC99">
Date Here </font>
</div>
</div>
</div>
</div>

That's the code from my site for where i want the posts to show up.

Link to comment
Share on other sites

  • 0

Ok I will give you the code to get all information from one topic showing the 3 latest posts..


<?php
error_reporting(E_ALL);
/*
+--------------------------------------------------------------------------
|   USAGE:
+--------------------------------------------------------------------------
 
Simply call this script via PHP includes, or SSI .shtml tags to generate content
on the fly, streamed into your own webpage.
 
+--------------------------------------------------------------------------
|   To show last 3 posts in reverse chronological last post date order from a single topic   
+--------------------------------------------------------------------------
 
include("http://domain.com/forums/ssi.php?topic_id=12345&post_count=3");                      /*noLibHook*//*TERANOTE: remove additional /*
 
*/
 
 
/**
* Main executable wrapper.
*
* Set-up and load module to run
*
* @package IP.Board
* @author   Matt Mecham
* @version 3.0
*/
 
define( 'CCS_GATEWAY_CALLED', TRUE ); // Prevents redirect checks in ipsRegistry
define( 'IPS_ENFORCE_ACCESS', TRUE ); // Prevents force login setting from returning a login page
define( 'IPB_THIS_SCRIPT', 'public' );
 
require_once( './initdata.php' );/*noLibHook*/
 
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
 
/**
* Path to SSI templates directory
*
*/
define( 'SSI_TEMPLATES_DIR', DOC_IPS_ROOT_PATH."ssi_templates" );
/**
* Maximum number of posts to show
*
*/
 
 
/* Go... */
$reg = ipsRegistry::instance();
$reg->init();
 
$ssi = new ssi( $reg );
 
class ssi
{
function __construct( ipsRegistry $registry )
{
$this->registry   =  $registry;
$this->DB         =  $this->registry->DB();
$this->settings   =& $this->registry->fetchSettings();
$this->request    =& $this->registry->fetchRequest();
$this->cache      =  $this->registry->cache();
$this->caches     =& $this->registry->cache()->fetchCaches();
$this->member     =  $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$max_posts = $count = 3;
 
if ( $this->request['topic_id'] )
{
$topicId = $this->request['topic_id'] ; 
if ($this->request['post_count']) 
{$count = $this->request['post_count'];}
}
else
{
fatal_error("Fatal error: no topic id specified");
}
 
//----------------------------------------
// Get the topics, member info and other stuff
//----------------------------------------
 
$this->DB->build( array( 'select' => 'p.*',
    'from'     => array( 'posts' => 'p' ),
    'where'    => "topic_id = ".$topicId,
    'add_join' => array( 0 => array(  'select' => 't.*',
  'from'   => array( 'topics' => 't' ),
  'where'  => "p.topic_id=".$topicId,
  'type'   => 'inner' ) ),
 'order'  => 'p.pid DESC',
 'limit'  => array( 0, $count ) ) );
 
$this->DB->execute();
  
if ( ! $this->DB->getTotalRows() )
{
fatal_error("Could not get the information from the database");
}
 
$HTML = '';
while ( $i = $this->DB->fetch() )
{
// echo "<pre><br>";print_r($i);echo "</pre>";
$to_echo = array (  'topic_title'    => str_replace( '&#', '&amp;#', $i['title'] ),
'topic_id'       => $i['tid'],
'topic_link'     => $this->settings['base_url']."showtopic=".$i['tid'],
'last_poster_id' => $i['last_poster_id'],
'last_post_name' => $i['last_poster_name'],
'last_post_time' => $this->registry->getClass('class_localization')->getDate( $i['last_post'] , 'LONG', 1 ),
'timestamp'      => $i['last_post'],
'starter_id'     => $i['starter_id'],
'starter_name'   => $i['starter_name'],
'board_url'      => $this->settings['board_url'] ,
'board_name'     => $this->settings['board_name'],
'rfc_date'       => date( 'r', $i['last_post'] )    
);
$HTML .= '
<div class="sub_page_c">
<div id="spc_head"><p>Title Here</p></div>
<div id="spc_cont">
<div align="center" class="dot">
Description Here</a><br> <div align="right">
<font color="FFCC99">
Date Here </font>
</div>
</div>
</div>
</div>
<div class="sub_page_c">
<div id="spc_head"><p>'.$to_echo['title'].'</p></div>
<div id="spc_cont">
<div align="center" class="dot">
'.$to_echo['topic_link'].'<br><br> <div align="right">
<font color="FFCC99">
'.$to_echo['rfc_date'].' </font>
</div>
</div>
</div>
</div>';
}
print $HTML ;
//----------------------------------------
// Print bottom...
//----------------------------------------
 
exit();
}
 
function fatal_error( $error )
{
print $error;
exit();
}
}

Link to comment
Share on other sites

  • 0

What did my last post say? You replace that line with your html something like this

<<<HTML
<div class="sub_page_c">
<div id="spc_head"><p>Title Here</p></div>
<div id="spc_cont">
<div align="center" class="dot">
Description Here</a><br> <div align="right">
<font color="FFCC99">
Date Here </font>
</div>
</div>
</div>
</div>
<div class="sub_page_c">
<div id="spc_head"><p>{$to_echo['title']}</p></div>
<div id="spc_cont">
<div align="center" class="dot">
{$to_echo['topic_link']}<br><br> <div align="right">
<font color="FFCC99">
{$to_echo['rfc_date']} </font>
</div>
</div>
</div>
</div>
HTML;

Why did you ask for the php code to get the information without the html if you had no idea how to use it

 

 

If I give you full access to my site can you just set it all up for me?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...