Jump to content

Recommended Posts

Posted

Hi all,

i wanna to make newsbar that move automatically and the informattion on it don't linked (i.e. can't click on it to go to link) just wanna news.

HOw i can do this?

Regards,

Xtremee


Posted

I don't think that is really depend on where are you getting the news from?

But any way i will use it for My Radio Station

Hope that you can help!

Regards,

Xtremee

Posted (edited)

If you just want to add the news to your html source files your can use this:

<marquee>This is news item 1 ** This is news item 2 ** This is news item3</marquee>

If you want to show news from items in a database you first have to connect to the database and fetch the items from the database. Using PHP and MySQL it would be something like this:

mysqlconnection.php:

<?php
function MySQL_connection()
{
$host = "hostname";
$user = "username";
$pass = "password";

$connection = mysql_connect($host, $user, $pass);
mysql_select_db ("databasename", $connection);
}
?>

newsbar.php

<?php
include("mysqlconnection.php");
MySQL_connection();
$qsqlnews = mysql_query("SELECT * FROM news");

While($row = @mysql_fetch_array($qsqlnews))
{
$title = $row["title"];
$message = $row["message"];
$date = $row["date"];
}

echo "<marquee><b>($date) $title</b> - $message ";
?>

Edit:

Ofcourse you have to edit $host, $user, $pass and databasename according to your situation

Edited by Darude1234
Posted

Hi all,

i wanna to get Automatic upgating news bar that i can use to put it in my website. i don't wanna to make this new bar my self using marquee

That is all

any idea will be excellent.

Regards,

Xtremee

Posted (edited)

Why did you open a new topic? What was wrong with my solution?

If you want to show news from items in a database you first have to connect to the database and fetch the items from the database. Using PHP and MySQL it would be something like this:

mysqlconnection.php:

<?php
function MySQL_connection()
{
$host = "hostname";
$user = "username";
$pass = "password";

$connection = mysql_connect($host, $user, $pass);
mysql_select_db ("databasename", $connection);
}
?>

newsbar.php

<?php
include("mysqlconnection.php");
MySQL_connection();
$qsqlnews = mysql_query("SELECT * FROM news");

While($row = @mysql_fetch_array($qsqlnews))
{
$title = $row["title"];
$message = $row["message"];
$date = $row["date"];
}

echo "<marquee><b>($date) $title</b> - $message ";
?>

Ofcourse you have to edit $host, $user, $pass and databasename according to your situation

Edited by Darude1234
Posted

Topics Merged

@xtremee - Please don't start a new topic if you've already got one. Your previous thread seemed to solve your problem. Reply there if you want more information.

Posted
i don't wanna to make this new bar my self using marquee

That is all

Remove the marquee quotes <marquee> and </marquee> :rolleyes:

Try to tell exactly what you want.

I think there are 3 options and I showed you these options:

Option 1. Put the news directly in the source code

Option 2. Getting the news from a database and show it to the user

Option 3. Put news lines, line by line in a text file and read every line in the text file using a script.

But the last option is almost the same as option 1.

Posted

@Darude1234,

1st thanks for your reply,

i wanna the new to be set automatically in my page without going to add them my self.

-> Option 1& 3 not my require

Regards,

Xtremee

Posted (edited)

So you're basically asking for a new bars that gets news from RSS news feeds? Just trying to help clarify what you want - I have no experience in dealing with RSS.

Edited by Chozo4
Posted

@Chozo4,

1st thanks for ur reoly

i don't wanna RSS news

i wanna a news bar which show the last news and update its contain automatically without modify its marquee every new news

Posted
@Chozo4,

1st thanks for ur reoly

i don't wanna RSS news

i wanna a news bar which show the last news and update its contain automatically without modify its marquee every new news

Well, in that case, what's wrong with my solution in post #7?

I still don't know what you want. If you want to change the contents automatically, try to understand that you need a source to get the news from like a database or text file, can't find another solution right now

  • 1 month later...
  • 1 month later...
Posted

Hi

Thanks for all who try to help

i wanna newsbar like this one in the top of http://www.soft32.com

i check the source of the page and i don't think that it is marquee. I think they use some java scripts!!

if it java can any one tell me what is the script that i need?

Thanks in advance

Regards,

Xtremee

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...