1
kesikkafa
how can i use this php code in a block
  • 2005/3/21 2:58

  • kesikkafa

  • Just popping in

  • Posts: 47

  • Since: 2005/2/6 2


<?php include("$DOCUMENT_ROOT/scroll.php");?>

This code is scrols last messages from phpbb forum on any where.
you can see the sample herehttp://www.kesikkafa.com/2.php

2
brash
Re: how can i use this php code in a block
  • 2005/3/21 3:44

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


I'd probably change the $DOCUMENT_ROOT to <{$xoops_url}> and try placing the code in a custom block with the format set to PHP Script.

3
kesikkafa
Re: how can i use this php code in a block
  • 2005/3/21 9:14

  • kesikkafa

  • Just popping in

  • Posts: 47

  • Since: 2005/2/6 2


you mean this.
<?php include("<{$xoops_url}>/scroll.php");?>

if yes it is not work

and i also try

<?php include("{$xoops_url}/scroll.php");?>

and

<?php include("http://www.kesikkafa.com/xo/scroll.php");?>

but i dont get success.

4
Bassman
Re: how can i use this php code in a block
  • 2005/3/21 9:24

  • Bassman

  • Friend of XOOPS

  • Posts: 1272

  • Since: 2003/5/23


You don't include the <?php and ?> tags when using php in a php block.

5
kesikkafa
Re: how can i use this php code in a block
  • 2005/3/22 9:01

  • kesikkafa

  • Just popping in

  • Posts: 47

  • Since: 2005/2/6 2


i try

include("<{$xoops_url}>/scroll.php");

and it again failed..i see only the name of the block.but the rest dont appears.. but this code is ok.it works on a single php page as i mentioned on my first message

6
tjnemez
Re: how can i use this php code in a block
  • 2005/3/22 9:46

  • tjnemez

  • Home away from home

  • Posts: 1594

  • Since: 2003/9/21


i am not a phper, but try this:

include '<{$xoops_url}>/scroll.php';

7
kesikkafa
Re: how can i use this php code in a block
  • 2005/3/22 10:31

  • kesikkafa

  • Just popping in

  • Posts: 47

  • Since: 2005/2/6 2


no..does not work..the rest of block does not appear.

8
tjnemez
Re: how can i use this php code in a block
  • 2005/3/22 17:02

  • tjnemez

  • Home away from home

  • Posts: 1594

  • Since: 2003/9/21


why not just add the html to the block?

9
shank
Re: how can i use this php code in a block
  • 2005/3/23 2:25

  • shank

  • Not too shy to talk

  • Posts: 144

  • Since: 2004/8/17


Create a custom PHP block and if your XOOPS instal is athttp://www.kesikkafa.com put this in the block
include("<{$xoops_url}>/xo/scroll.php");


if it is athttp://www.kesikkafa.com/xo/ put this in the block
include("<{$xoops_url}>/scroll.php");


Should work.

10
kesikkafa
Re: how can i use this php code in a block
  • 2005/3/23 5:58

  • kesikkafa

  • Just popping in

  • Posts: 47

  • Since: 2005/2/6 2


no.what a code!!! it is working on a single php page but not on xoops.
my XOOPS is in the directoryhttp://www.kesikkafa.com/xo

and scroll.php is in /xo and kesikkafa.com main directory also...and the code of scroll.php is here:

<?php
//
// Basic Configuration
// How Many Topics you want to display?
$topicnumber = 20;
// Scrolling towards up or down?
$scroll = "up";
// Change this to your phpBB path
$urlPath = "http://www.kesikkafa.com/forum";

// Database Configuration (Where your phpBB config.php file is located
include 'forum/config.php';

// Connecting & Selecting Databases
$table_topics = $table_prefix. "topics";
$table_forums = $table_prefix. "forums";
$table_posts = $table_prefix. "posts";
$table_users = $table_prefix. "users";
$link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("Could not connect");
mysql_select_db("$dbname") or die("Could not select database");

// Perform Sql Query
$query = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM $table_topics t, $table_forums f, $table_posts p, $table_users u
WHERE t.topic_id = p.topic_id AND
f.forum_id = t.forum_id AND
t.topic_status <> 2 AND
p.post_id = t.topic_last_post_id AND
p.poster_id = u.user_id
ORDER BY p.post_id DESC LIMIT $topicnumber";
$result = mysql_query($query) or die("Query failed");

// Outcome of the HTML
// Be carefull when you edit these!
print "<marquee id=\"recent_topics\" behavior=\"scroll\" direction=\"$scroll\" height=\"100\" scrolldelay=\"50\" scrollamount=\"2\" onMouseOver=\"document.all.recent_topics.stop()\" onMouseOut=\"document.all.recent_topics.start()\">
<table cellpadding='5' cellSpacing='5' width='200' align='center'>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<tr valign='top'><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#cc0000\"><b><a href=\"$urlPath/viewtopic.php?topic=$row[topic_id]&forum=$row[forum_id]\">" .
$row["topic_title"] .
"</a></td></font></b><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#cc0000\">" .
"</td></tr></font>";
}
print "</table></marquee>";

// Free Result
mysql_free_result($result);

// Close the Connection
mysql_close($link);
?>

Login

Who's Online

167 user(s) are online (102 user(s) are browsing Support Forums)


Members: 0


Guests: 167


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits