TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 375
  • Total: 376
  • @rjen

Call script problem

Started by The Wizard, November 20, 2010, 06:38:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

The Wizard

Link to my site: http://www.tribeuniverse.com
SMF version: 2.0 RC4
TP version: 1.0 RC1
Default Forum Language: English
Theme name and version:CurveLife
Browser Name and Version: IE
Mods installed:Tiny Portal, Aeva Media
Related Error messages: None

Hello:
I'm not too good at php, but you learn as you go on that. Anyway I need a little help with the code below. I'm tryning to get it to output something like this -

Quotehttp://www.tribeuniverse.com/index.php?page=319;Z=509

Where 509 is the posted message id.

This script is intened to list all the topics in a choosen board, create the topics as links and when you click on a topic link it will take you to page 319 where the second part of this script will show you only the first post. To pull this off I need this script to send the following data - Z= and the first post id to page 319.
Any help would be usefull.
Thanks

Quoteecho '<div style="background-image:url(\'http://www.tribeuniverse.com/tribe-images/tribe-images/big_backgrounds/nature.jpg\');"> ';

require_once('SSI.php');

// Include News Board (12) and limit to 1000 topic
// by The Wizard
$news = ssi_boardNews(12, 1000, null, null, 'array');

$P = 319;

foreach ($news as $topic)
{
// Test script below //
echo ('<a href="'.$topic['href'].'">'.$topic['subject'].'</a></br>');

// Real Script //
echo('<a href=" '.$scripturl. ?page=  . $P . msg . Z=$topic['id_msg'] . ' ">'.$topic['subject'].'</a></br>');


};
echo '
</div>';

IchBin

Maybe something like this:
echo '<div style="background-image:url("http://www.tribeuniverse.com/tribe-images/tribe-images/big_backgrounds/nature.jpg");">';

require_once('SSI.php');

// Include News Board (12) and limit to 1000 topic
// by The Wizard
$news = ssi_boardNews(12, 1000, null, null, 'array');

$P = 319;

if (!isset($_GET['Z'])) {

foreach ($news as $topic)
{

// Real Script //
echo'<a href="'.$scripturl. '?page='. $P .';Z='. $topic['message_id'] .'">'. $topic['subject'] .'</a></br>';

}
}
else {
$postID = (int) $_GET['Z'];

$output = ssi_fetchPosts($postID, false, 'array');

        foreach ($output as $post) {
echo '<h3> ' , $post['subject'] , '</h3>
<div> ' , $post['body'] ,  '</div>';
}
}
echo '
</div>';

The Wizard

YES!!!! YOU THE MAN IchBin!!

This has made my day!!! Works like a dream....

Note: I'm off tomorrow, and I will post all the code then and how to use the thing. I think some other users out there will want this feature and I'm thinking that if it was cleaned up a bit and a few more options added it might make a good addition to TP as a mod or whatever. I think this might be a easy way for admins to add posts to articles, or thats my reason anyway.

Thanks again to everybody who helped!

The Wizard

IchBin

Glad to help. You've done pretty good on your own if you ask me. :)

This website is proudly hosted on Crocweb Cloud Website Hosting.