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

[syntax=php]$entries = $xpath->query('//img');[/syntax]
And then check it using,

[syntax=php]$total = count($entries);[/syntax]
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

[syntax=xhtml]<img src="something" width="100" height="100" />[/syntax]
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

[syntax=xhtml]<img src="something" width="100" height="100" />[/syntax]
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

[syntax=php]echo "$naslov, $opis, $sadrzaj, $izvor,, $url, $datum1, $datum2, <img src='$urlslike'/> </br></br>";[/syntax]

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

[syntax=php]echo "$naslov, $opis, $sadrzaj, $izvor,, $url, $datum1, $datum2, <img src='$urlslike'/> </br></br>";[/syntax]


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/2011-06-05/156013_sampioni_kf.jpg?ver=1307647416"><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/2011-06-05/156013_sampioni_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:

[syntax=php]<div>
<div><?php echo "$urlslike; ?></div>
<div><?php echo "$text; ?></div>
</div>[/syntax]

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?thumbId=1686980&amp;fileSize=56800&amp;contentType=image/pjpeg&amp;lastModified=1307717172000"


this is code how to i get image url form article $sadrzaj


[syntax=php]$test = preg_match_all('/\"(.*?)\"/', $sadrzaj, $matches);
$slika2 = str_replace( '"','',$matches[0][0]);

echo $slika2;[/syntax]

How to get text ?

Re: Rss with image: $image value

Posted: Sun Jun 12, 2011 12:10 pm
by jacek
You could probably use

[syntax=php]strip_tags($sadrzaj);[/syntax]
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
hostingebc wrote:you can see finall resolt.
http://www.moravaprom.com/ebchost/prikaz.php

404 not found