PDA

View Full Version : Search able.


gigiloumill
12-23-2009, 03:19 PM
Guys, are these RSS Feeds able to be searched by search engines?

Corrosive
12-23-2009, 03:27 PM
As long as the output is HTML then I see no reason why not.

gigiloumill
12-23-2009, 03:44 PM
O.K. I understand JS is not capable. is that right? thanks

gigiloumill
12-23-2009, 03:46 PM
As long as the output is HTML then I see no reason why not.

Even though the feed is importing text from another site, engines would be able to find on your site?

Corrosive
12-23-2009, 03:57 PM
That is a good question. Here's what I'd do; open your page in a browser, view>source and see if the text of your RSS is in the page. If it shows up then chances are it will show up for a Search Engine....Or that is my theory anyway :)

gigiloumill
12-23-2009, 04:16 PM
No. it doesn't show up.

Corrosive
12-23-2009, 04:20 PM
Then I'd say it probably won't be read or indexed.

gigiloumill
12-23-2009, 04:32 PM
C, do you know the code for a border to space feed content? Thanks

Corrosive
12-23-2009, 04:40 PM
Your going to have to elaborate on that question.

gigiloumill
12-23-2009, 04:43 PM
O.K. As the RSS Feed content comes in, I would like to include a line spacer between feeds. such as a dotted line.

Corrosive
12-23-2009, 04:46 PM
The css for a dotted right border is {border-right: 1px dotted #000;} Does that help?

gigiloumill
12-23-2009, 06:19 PM
Dude, you're a genius....

gigiloumill
12-23-2009, 06:24 PM
C, one more question: I set up the code to wrap the text around the image. My only problem is I can't get the top of the text to be even with the top of the image. Any suggestions? The image floats to the left and obviously the code to the right but, the text is lower that the image. Here's the complete code:

.title a{
font-family:"Times New Roman", Times, serif;
font-size: 14px;
color: #333;
background-color: #FFF;
font-weight : bold;
line-height : 1.1em;
overflow : hidden;
white-space : wrap;
text-decoration: none;
text-transform:capitalize;
text-align:left;
}

a:link {
text-decoration: none;
}
a:visited {
text-decoration:none;
}
a:hover {
text-decoration:underline;
}
a:active {
text-decoration:none;
}

.description a{

font-family:Verdana, Geneva, sans-serif;
font-size: 12px;
color: #333;
background-color: #FFF;
text-decoration:none;
border-bottom:thin;
line-height : 1.4em;
overflow : hidden;
white-space : wrap;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 0px;
border-bottom:thin;
border-bottom-color:#FFF;
border-bottom-style:dotted;
border-spacing:inherit;
border-collapse:separate;
}

.description a:link {
text-decoration: none;
}
.description a:visited {
text-decoration:none;
}
.description a:hover {
text-decoration:underline;
}
.descrption a:active {
text-decoration:none;
}

.description {
text-align:justify;

}

.description {border-bottom: 1px dotted #000;}
a img {
border-style: none;
float:left;margin:0 5px 0 0


}

ul, li {
list-style-type:none;
}

Corrosive
12-23-2009, 06:27 PM
Dude, you're a genius....

Really? :lol:

Corrosive
12-23-2009, 06:28 PM
C, one more question: I set up the code to wrap the text around the image. My only problem is I can't get the top of the text to be even with the top of the image. Any suggestions? The image floats to the left and obviously the code to the right but, the text is lower that the image. Here's the complete code:

.title a{
font-family:"Times New Roman", Times, serif;
font-size: 14px;
color: #333;
background-color: #FFF;
font-weight : bold;
line-height : 1.1em;
overflow : hidden;
white-space : wrap;
text-decoration: none;
text-transform:capitalize;
text-align:left;
}

a:link {
text-decoration: none;
}
a:visited {
text-decoration:none;
}
a:hover {
text-decoration:underline;
}
a:active {
text-decoration:none;
}

.description a{

font-family:Verdana, Geneva, sans-serif;
font-size: 12px;
color: #333;
background-color: #FFF;
text-decoration:none;
border-bottom:thin;
line-height : 1.4em;
overflow : hidden;
white-space : wrap;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 0px;
border-bottom:thin;
border-bottom-color:#FFF;
border-bottom-style:dotted;
border-spacing:inherit;
border-collapse:separate;
}

.description a:link {
text-decoration: none;
}
.description a:visited {
text-decoration:none;
}
.description a:hover {
text-decoration:underline;
}
.descrption a:active {
text-decoration:none;
}

.description {
text-align:justify;

}

.description {border-bottom: 1px dotted #000;}
a img {
border-style: none;
float:left;margin:0 5px 0 0


}

ul, li {
list-style-type:none;
}


I'd really need to see the html as well if possible?

gigiloumill
12-23-2009, 06:38 PM
here you go.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<link rel="stylesheet" type="text/css" href="CSS/onetime.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--

.testone {
float: left;
height: 1800px;
width: 300px;
overflow: auto;
margin-right: 30px;
}

-->
</style>
</head>

<body>
<div class="testone"><span class="test">
<?php
require_once('magpierss/rss_fetch.inc');

$num_items = 5;
$rss = fetch_rss( 'http://cgi.askmen.com/RSS/askmenRSS_channel.php?ID=gossip' );
$items = array_slice($rss->items, 0, $num_items);
foreach ($items as $item) {
$href = $item['link'];
$title = $item['title'];
$description = $item ['description'];
$created = $item['created'];
echo "<li class=title><a href=$href>$title</a> $created</li>\n";
echo "<li class=description><a href=$href>$description</a> $created</li>\n";
echo "</ul>";
}
?>
</span></div>
</body>
</html>

You have the complete CSS code as well. Thanks

Corrosive
12-23-2009, 06:42 PM
Try adding margin: 0; padding 0; to your ul style

gigiloumill
12-23-2009, 06:47 PM
Doesn't do anything..

Corrosive
12-23-2009, 06:49 PM
And the RSS feed isn't outputting into paragraph tags or anything like that? Is this live anywhere?

gigiloumill
12-23-2009, 06:53 PM
no , it's not live. and I don't see any p tags.

Corrosive
12-23-2009, 06:58 PM
Where is your opening <ul> tag?

gigiloumill
12-24-2009, 02:37 AM
Sorry I had to go. Here's the ul tag

ul, li {
background: #FFF;
list-style-type: none;
float: left;
overflow: hidden;
}

gigiloumill
12-24-2009, 02:41 AM
This one doesn't do anything either.

ul, li {
background: #FFF;
list-style-type: none;
float: left;
border: 0px solid #CCC;
margin: 0px 0px 0px 0;
padding: 0 ;

overflow: hidden;
}

Corrosive
12-24-2009, 05:46 AM
No mate, I meant where is your opening ul tag in your PHP output. I know that you have the CSS done. Here:

$created = $item['created'];
echo "<li class=title><a href=$href>$title</a> $created</li>\n";
echo "<li class=description><a href=$href>$description</a> $created</li>\n";
echo "</ul>";

I'd expect to see

echo "<ul>";

at the start to tell the browser it is a list. Unless this is created somewhere else then you are not using a ul and any style changed you make will not register.

gigiloumill
12-24-2009, 02:45 PM
No mate, I meant where is your opening ul tag in your PHP output. I know that you have the CSS done. Here:

$created = $item['created'];
echo "<li class=title><a href=$href>$title</a> $created</li>\n";
echo "<li class=description><a href=$href>$description</a> $created</li>\n";
echo "</ul>";I'd expect to see

echo "<ul>";at the start to tell the browser it is a list. Unless this is created somewhere else then you are not using a ul and any style changed you make will not register.

I've tried it with "<ul> and "<ul></ul> and still doesn't do it.

Corrosive
12-24-2009, 02:50 PM
You still need to have that opening <ul> tag echoed so leave it in there. Honestly though, without seeing this live somewhere, it is going to be tough to say what is wrong.

gigiloumill
12-24-2009, 05:40 PM
Thanks for all your help. Have a merry Christmas.

gigiloumill
12-24-2009, 05:51 PM
C, let me ask you one more question: I have this pagination script. (see below), I am trying to ad CSS to it but I can't seem to make it work. Can you tell me what I'm not seeing? Thanks
<?php
/*
Place code to connect to your DB here.
*/
$username="root";
$password="root";
$database="pagination";

$dbh=mysql_connect(localhost,$username,$password) or die ('I cannot connect to the database because: ' . mysql_error());
@mysql_select_db($database);
// include your code to connect to DB.

$tbl_name="louie"; //your table name
// How many adjacent pages should be shown on each side?
$adjacents = 3;

/*
First get total number of rows in data table.
If you have a WHERE clause in your query, make sure you mirror it here.
*/
$query = "SELECT COUNT(*) as num FROM $tbl_name";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];

/* Setup vars for query. */
$targetpage = "index.php"; //your file name (the name of this file)
$limit = 10; //how many items to show per page
$page = $_GET['page'];
if($page)
$start = ($page - 1) * $limit; //first item to display on this page
else
$start = 0; //if no page var is given, set start to 0

/* Get data. */
$sql = "SELECT image_path, image_text FROM $tbl_name ORDER BY id DESC LIMIT $start, $limit";
$result = mysql_query($sql);


/* Setup page vars for display. */
if ($page == 0) $page = 1; //if no page var is given, default to 1.
$prev = $page - 1; //previous page is page - 1
$next = $page + 1; //next page is page + 1
$lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
$lpm1 = $lastpage - 1; //last page minus 1

/*
Now we apply our rules and draw the pagination object.
We're actually saving the code to a variable in case we want to draw it more than once.
*/
while($row = mysql_fetch_array($result)){
echo "<img src='{$row['image_path']}' alt=' ' /><br />";
echo "".$row['image_text']."<br />";
}
$pagination = "";
if($lastpage > 1)
{
$pagination .= "<div class=\"pagination\">";
//previous button
if ($page > 1)
$pagination.= "<a href=\"$targetpage?page=$prev\"> previous</a>";
else
$pagination.= "<span class=\"disabled\"> previous</span>";

//pages
if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage?page=$counter\">$counter</a>";
}
}
elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
{
//close to beginning; only hide later pages
if($page < 1 + ($adjacents * 2))
{
for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage?page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage?page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage?page=$lastpage\">$lastpage</a>";
}
//in middle; hide some front and some back
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
{
$pagination.= "<a href=\"$targetpage?page=1\">1</a>";
$pagination.= "<a href=\"$targetpage?page=2\">2</a>";
$pagination.= "...";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage?page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage?page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage?page=$lastpage\">$lastpage</a>";
}
//close to end; only hide early pages
else
{
$pagination.= "<a href=\"$targetpage?page=1\">1</a>";
$pagination.= "<a href=\"$targetpage?page=2\">2</a>";
$pagination.= "...";
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage?page=$counter\">$counter</a>";
}
}
}

//next button
if ($page < $counter - 1)
$pagination.= "<a href=\"$targetpage?page=$next\">next </a>";
else
$pagination.= "<span class=\"disabled\">next </span>";
$pagination.= "</div>\n";
}
echo "\n".$pagination;
?>

and the CSS .image_text{

font-family:Verdana, Geneva, sans-serif;
font-size: 12px;
color: #333;
background-color: #FFF;
text-decoration:none;
border-bottom:thin;
line-height : 1.4em;
overflow : hidden;
white-space : wrap;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 0px;

}

. a:link {
text-decoration: none;
}
.image_text a:visited {
text-decoration:none;
}
.image_text a:hover {
text-decoration:underline;
}
.image_text a:active {
text-decoration:none;
}

.image_text {
text-align:left;

}

.image_text {border-bottom: 1px dotted #F00;}
.image_path a {
border: 1px solid #ccc;
vertical-align: left;
}

ul, li {

list-style-type: none;


}


Thanks