Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-09-28 16:23:17

SpeedAirMan
New Member
Registered: 2006-01-28
Posts: 7

Need to extract link to article & link to article's image

Hi,

i’m webmaster of a site under Txp : http://www.parkour-videos.com/

One video per page/article, with a description and a screenshot.

Links to the videos/articles are then often posted on forums, and sometimes on website.
What I would like is to incitate and make it easier to share the link by give them a permanent link to the article, the code to the article with a screenshot in HTML, and the code to the article with a screenshot in BBCode.

Let me show you an example :
http://www.koreus.com/media/tete-envers.html (click on “Ajouter à votre blog”)

Here is ~ what I would like :
<code>
Permanent link : http://www.parkour-videos.com/videos/excite-with-vigroux
HTML link + screenshot : <a href=“http://www.parkour-videos.com/videos/excite-with-vigroux” title=“Excite with Stephane Vigroux – Parkour-videos.com” target=”_blank”><img src=“http://www.parkour-videos.com/images/screenshots/excite-with-vigroux-TN-150-Parkour.NET.jpg” alt=“Screenshot Excite with Stephane Vigroux” /><br />Excite with Stephane Vigroux</a> – <a href=“http://www.parkour-videos.com” title=“Parkour-videos.com : Only GOOD Parkour videos” target=”_blank”>Parkour-videos.com</a>
BBCode link + screenshot : [.url. = http://www.parkour-videos.com/videos/excite-with-vigroux][img.]http://www.parkour-videos.com/images/screenshots/excite-with-vigroux-TN-150-Parkour.NET.jpg[/img]
Excite with Stephane Vigroux[/url] – [url.=http://www.parkour-videos.com/]Parkour-videos.com[/url]
</code>

And so, I would need to extract :
  • article’s title (ok : <code><txp:title /></code>)
  • the link to the article (NOT ok. Only found that : <code><txp:permlink></code> but it generate the HTML code < a href = “… and with that… i don’t see how i could do)
  • the link to the screenshot/picture associated with the article (NOT ok. Only found that : <code><txp:article_image /></code> which generate the complete code to display the picture : < img src = “… )

Any ideas ?!

Thanks by advance !

Offline

#2 2006-09-28 16:34:40

alesh
Member
From: Miami, FL
Registered: 2005-04-13
Posts: 228
Website

Re: Need to extract link to article & link to article's image

The permlink is output by <txp:permlink />. No clue about the article image.


Yes, I have tried turning it off and on.

Offline

#3 2006-09-28 16:39:03

SpeedAirMan
New Member
Registered: 2006-01-28
Posts: 7

Re: Need to extract link to article & link to article's image

Thanks ! :-)

Just waiting the link to the screenshot now… I hope it’s possible !

Offline

#4 2006-09-28 21:26:12

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Need to extract link to article & link to article's image

Something like this?
<code>
<a href=”<txp:permlink />” title=”<txp:title /> – <txp:sitename />” target=”_blank”><txp:article_image /><br /><txp:title /></a></code>

Offline

#5 2006-09-28 21:50:52

SpeedAirMan
New Member
Registered: 2006-01-28
Posts: 7

Re: Need to extract link to article & link to article's image

Yes, sounds good/ok (thanks for it) but the problem will be for the BBCode. It’s why it would also be useful to be able to extract the link of the “article_image”.

If you have another idea…

Offline

#6 2006-09-28 22:31:16

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Need to extract link to article & link to article's image

Ah… you mean just the url… I suppose it can be done with php, but I don’t know how, sorry.

Offline

#7 2006-09-29 06:07:17

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,391
Website GitHub Mastodon

Re: Need to extract link to article & link to article's image

You might use upm_image to get the image URL with the help of a proper form:

Include this snippet into the article form:

<txp:upm_article_image form="any-name-here" />

upm_article_image processes a user definable form with a choice of upm_image-specific tags, one of them being <txp:upm_img_full_url />. So, as a second step, define a misc form named according to the attribute’s value from the tag above (“any-name-here”) and with this content:

<txp:upm_img_full_url />

Voilà!

Offline

Board footer

Powered by FluxBB