Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: How to make the Title of your article a clickable link  (Read 9533 times)

Elijah Pemberton

  • Newbie
  • *
  • Karma: 0
  • Posts: 2
    • http://thepemberton.com
How to make the Title of your article a clickable link
« on: March 17, 2007, 05:09:15 AM »

Hello all!

I found that I wanted to make the title of my article have a clickable link, so it will be easier for users (and myself) to view the individual page for article without having to click "Comments." I thought I'd share this snippet.

Search for:
Code: [Select]
else {echo $r['title'];}and replace it with:
Code: [Select]
else {echo ''.$r['title'].'';}Cheers!
Logged

hafing

  • Full Member
  • ***
  • Karma: 1
  • Posts: 174
How to make the Title of your article a clickable link
« Reply #1 on: March 17, 2007, 12:21:07 PM »

Thank you for input.

But I liked this at your website.

http://thepemberton.com/go/videos/mac-vs-pc/

hafing
 :cool:
Logged
I can be 2fast and 2curious

mosh

  • Hero Member
  • *****
  • Karma: 77
  • Posts: 510
  • Awesome day :)
    • cms-zen
How to make the Title of your article a clickable link
« Reply #2 on: March 17, 2007, 04:16:14 PM »

nice thank you  :D

bramsyuur

  • Hero Member
  • *****
  • Karma: 23
  • Posts: 873
    • http://snews.vietbee.net
How to make the Title of your article a clickable link
« Reply #3 on: March 17, 2007, 04:36:49 PM »

Welcome Elip to sNews world!  ;)
Well, you don't have links to your articles because these articles are currently in "full view", no more text are hidden. The link to the tittle appears automatically when you're using the "break" option when you're editing the article. If you write all the contents of your article and don't put a "break" to hide the rest of it... no link to title is created.
Logged
La comunidad sNews en tu idioma!
Comunidad sNews en Espaņol

John

  • Newbie
  • *
  • Karma: 0
  • Posts: 15
    • http://wow-factor.com
How to make the Title of your article a clickable link
« Reply #4 on: March 24, 2007, 11:21:22 PM »

Mmm  I like having active links no matter what view
my edit is..
Code: [Select]
else {echo ''.$r['title'].'';}

BuLe Bali

  • Full Member
  • ***
  • Karma: 2
  • Posts: 100
    • A World Full of Doubts
How to make the Title of your article a clickable link
« Reply #5 on: March 29, 2007, 05:23:07 AM »

Thx elip. That's really helpfull.
Logged
This world are full of doubts! No systems is secure. No systems!
@yohanesbule

DavidF

  • Newbie
  • *
  • Karma: 0
  • Posts: 16
    • http://www.davidfrosdick.com
How to make the Title of your article a clickable link
« Reply #6 on: April 18, 2007, 01:02:11 AM »

John,

Nice site!  Can I ask how you get the date and category to show under the title on your Wow-Factor site?

Thanks
David
Logged

John

  • Newbie
  • *
  • Karma: 0
  • Posts: 15
    • http://wow-factor.com
How to make the Title of your article a clickable link
« Reply #7 on: April 18, 2007, 01:37:07 AM »

Hi DavidF
I use http://b2evolution.net/  for wow-factor.com  (it's 7 years old ) and elements like date and categories etc are just styled snippets from the .php files that drive it.
I don't know what would be required to do this with sNews, though I'm sure it's possible. These guys sure know their stuff, as do the B2Evo developers.   :)

vido

  • Newbie
  • *
  • Karma: 0
  • Posts: 3
How to make the Title of your article a clickable link
« Reply #8 on: May 11, 2007, 03:38:31 PM »

i cant find --->else {echo $r['title'];}

where is this?
Logged

Joost

  • Guest
How to make the Title of your article a clickable link
« Reply #9 on: May 12, 2007, 07:36:12 AM »

Estimated: line 500
In here:
Code: [Select]
echo '<h2>';
if (strlen($text) > $shorten) {
echo '<a href="'.db('website').$category.'/'.$r['seftitle'].'/" title="'.$r['title'].'">'.$r['title'].'</a>';
}
else {echo $r['title'];}
echo '</h2>';
« Last Edit: May 28, 2008, 06:36:06 PM by Keyrocks »
Logged

snesDS

  • Newbie
  • *
  • Karma: 0
  • Posts: 3
Re: How to make the Title of your article a clickable link
« Reply #10 on: May 28, 2008, 04:08:22 PM »

How would I do this in version 1.6 - can't find the code :(

Search for:
Code: [Select]
else {echo $r['title'];}and replace it with:
Code: [Select]
else {echo '<a href="'.db('website').$category.'/'.$r['seftitle'].'/" title="'.$r['title'].'">'.$r['title'].'</a>';}Cheers!
Logged