Page 2 of 2
Re: Rss with image: $image value
Posted: Fri Jun 10, 2011 7:27 pm
by jacek
1. That's a styling thing, you probably want to put each article in a div tag and add some margin to that tag. It would probably be easier to search for things like "div tag" "css styling" "css positioning" on google, you would find stuff in your own language
2. You have to try each method, if it fails move on to the next method and so on. For example you could try
$entries = $xpath->query('//img');
And then check it using,
$total = count($entries);
To see how many results you got.
Re: Rss with image: $image value
Posted: Fri Jun 10, 2011 8:58 pm
by hostingebc
1. question
http://www.moravaprom.com/ebchost/prikaz.php
if you see this, you will see the problem:
1. Picture dimension,
2. picture position,
3. link lenght problem (i know how to resolve, becose is separetet from <item> part )
that i can not control if i do not have imege url. for example $urlimage = url img from item;
2.question - thank, i will try. it seems to me logical and understand how to do
NOTE: I've mastered the basics of PHP and mjskl's. RSS reader is something new to me, and I see it as useful, because I get into so much detail
Re: Rss with image: $image value
Posted: Fri Jun 10, 2011 11:09 pm
by jacek
You can set the dimensions of the image just by setting the width and height in the tag like this
<img src="something" width="100" height="100" />
for 100x100 pixels.
Re: Rss with image: $image value
Posted: Fri Jun 10, 2011 11:51 pm
by hostingebc
Greate, i know for this. Thanks
jacek wrote:You can set the dimensions of the image just by setting the width and height in the tag like this
<img src="something" width="100" height="100" />
for 100x100 pixels.
but somthin is ? which value? which url? that's what interests me?
Re: Rss with image: $image value
Posted: Fri Jun 10, 2011 11:55 pm
by jacek
Something would be the url of the image you want to display.
Re: Rss with image: $image value
Posted: Sat Jun 11, 2011 8:24 am
by hostingebc
jacek wrote:Something would be the url of the image you want to display.
i know, but how to get url?
I need to separate url and text in two diferent div, an then to show tem
Re: Rss with image: $image value
Posted: Sat Jun 11, 2011 10:36 am
by jacek
Is the URL not the same as the one you use in the img tag here
echo "$naslov, $opis, $sadrzaj, $izvor,, $url, $datum1, $datum2, <img src='$urlslike'/> </br></br>";
Re: Rss with image: $image value
Posted: Sat Jun 11, 2011 12:03 pm
by hostingebc
we are lost in the translation of the last few comments on this topic
jacek wrote:Is the URL not the same as the one you use in the img tag here
echo "$naslov, $opis, $sadrzaj, $izvor,, $url, $datum1, $datum2, <img src='$urlslike'/> </br></br>";
Trust me, this is not problem form me. I know this and andrsthend...
I will try now through the examples to be as concrete more as possible
this is content form
SADRZAJ field in
rss_vesti tabele (this have value of
item part of rss - beginig part of body in article news like you say):
<img src="
http://www.vesti-online.com/data/images ... br/>Upravo zavrÅ¡ena klupska sezona obeležena je potpunom dominacijom Partizana, s obzirom da su sekcije naÅ¡eg najbrojnijeg sportskog druÅ¡tva osvojile Äak 11 pehara u pet najpopularnijih kolektivnih sportova.<br/><br/>
ok.
1. How to get value
"http://www.vesti-online.com/data/images ... oni_kf.jpg" in $urlslike (translation - $imageurl) and
2. rest part of content form rss "
Upravo zavrÅ¡ena klupska sezona obeležena je potpunom dominacijom Partizana, s obzirom da su sekcije naÅ¡eg najbrojnijeg sportskog druÅ¡tva osvojile Äak 11 pehara u pet najpopularnijih kolektivnih sportova." in $text
with
$urlslike and
$text i want to do the following:
<div>
<div><?php echo "$urlslike; ?></div>
<div><?php echo "$text; ?></div>
</div>
I hope I'm far more understandable now. thanks
Re: Rss with image: $image value
Posted: Sat Jun 11, 2011 1:57 pm
by jacek
You already have
http://www.vesti-online.com/data/images ... 1307647416 in the variable $urlslike
that is what you should use.
Re: Rss with image: $image value
Posted: Sun Jun 12, 2011 11:59 am
by hostingebc
Content of article $sadrzaj is:
Atletska zvezda sa Jamajke želi da igra na Old Trafordu. Usain Bolt smatra da je dovoljno dobar da bude deo tima Aleksa Fergusona. Misli da bi trebalo da “dotera†tehniku, ali i da sada poseduje dovoljno kvaliteta da nosi dres “crvenih Ä‘avolaâ€.
<img src="
http://www.rts.rs/thumbnail/bolt-t.jpg? ... 7717172000"
this is code how to i get image url form article $sadrzaj
$test = preg_match_all('/\"(.*?)\"/', $sadrzaj, $matches);
$slika2 = str_replace( '"','',$matches[0][0]);
echo $slika2;
How to get text ?
Re: Rss with image: $image value
Posted: Sun Jun 12, 2011 12:10 pm
by jacek
You could probably use
strip_tags($sadrzaj);
as the text.
Re: Rss with image: $image value
Posted: Sun Jun 12, 2011 12:19 pm
by hostingebc
Greate, thanks
Problem is solved
you can see finall resolt.
http://www.moravaprom.com/ebchost/prikaz.php
Now i can make the rss blog
Re: Rss with image: $image value
Posted: Sun Jun 12, 2011 3:07 pm
by Temor