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.

Pages: 1 [2]

Author Topic: [ADDON] Template download + statistics (sNews 1.4)  (Read 9786 times)

David

  • Hero Member
  • *****
  • Karma: 7
  • Posts: 567
[ADDON] Template download + statistics (sNews 1.4)
« Reply #15 on: June 10, 2006, 09:50:25 am »

thanks keyrocks, but all these things are done.
Logged

mininovax

  • Newbie
  • *
  • Karma: 1
  • Posts: 44
    • http://www.ondapc.net
[ADDON] Template download + statistics (sNews 1.4)
« Reply #16 on: December 05, 2006, 04:46:22 pm »

Quote from: Patric
So, this makes the top 5 downloads names listed on my frontpage, and if clicking you get the download link directly... I'm trying to connect a hover effect to these links aswell, so that you see a thumb of each design upon hovering before you click the download link .... But we'll see if that's possible as I'm no PHP guru, so to speak :)
Patric, you might want to look into a 3rd party application extension like Lightbox for this type of affect. Good Luck.
Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[ADDON] Template download + statistics (sNews 1.4)
« Reply #17 on: December 05, 2006, 05:22:38 pm »

Why ? It works.
Logged
"It's only dead fish that goes with the flow... "
Updated

piXelatedEmpire

  • MIA
  • ULTIMATE member
  • ******
  • Karma: 37
  • Posts: 1401
  • currently MIA
[ADDON] Template download + statistics (sNews 1.4)
« Reply #18 on: December 06, 2006, 12:49:17 am »

I think miniovax means for the thumbnail hover affect you may want to look at a third party application.

Please let us know what solution you go with if you implement this feature! :D
Logged
my apologies to the sNews crew, but I will be MIA for the forseeable future

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[ADDON] Template download + statistics (sNews 1.4)
« Reply #19 on: December 06, 2006, 07:48:33 am »

ahhh, sorry for my not understanding... That hover effect is solved. I ended up using a solution I can't remember where I got... Possibly at cssplay.co.uk, but I'm not sure...

I use this CSS:
Quote
.thumbnail img{
border: 1px solid #fff;
margin: 15px;
}
.thumbnail:hover{
background-color: transparent;
}
.thumbnail:hover img{
border: 1px solid #000;
}
.thumbnail span{ /*CSS for enlarged image*/
position: absolute;
background-color: #aba;
padding: 3px 3px 4px 3px;
left: -1000px;
border: 1px solid #767676;
visibility: hidden;
color: black;
text-decoration: none;
text-align:center;
}
.thumbnail span img{ /*CSS for enlarged image*/
border-width: 0;
padding: 2px;
}
.thumbnail:hover span{ /*CSS for enlarged image*/
visibility: visible;
top: 491px; /*position where enlarged image should offset vertically*/
left: 400px; /*position where enlarged image should offset horizontally */

z-index: 50;
}
And you need to creat a new line in the download table, called thumbs:
thumbs, varchar not null


And almost the same PHP snippet as above. Hover thiny in red...
Quote
$query = "SELECT * FROM download ORDER BY downloads DESC LIMIT 5";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {
echo "".$r['title']." \"\"        (".$r['downloads'].")
";
}
?>
Patric.
Logged
"It's only dead fish that goes with the flow... "
Updated

Mika

  • Hero Member
  • *****
  • Karma: 9
  • Posts: 1377
    • http://www.ni5ni6.com/
[ADDON] Template download + statistics (sNews 1.4)
« Reply #20 on: December 06, 2006, 08:24:32 am »

Pat's PHP code without escaping double quotes:
Quote
$query = "SELECT * FROM download ORDER BY downloads DESC LIMIT 5";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {
# missing href title attribute
# why is there a span tag enclosing image?

echo ''.$r['title'].' ('.$r['downloads'].')
';
}
?>
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[ADDON] Template download + statistics (sNews 1.4)
« Reply #21 on: December 06, 2006, 10:59:42 am »

ahhh, domo Mika-san
Logged
"It's only dead fish that goes with the flow... "
Updated

piXelatedEmpire

  • MIA
  • ULTIMATE member
  • ******
  • Karma: 37
  • Posts: 1401
  • currently MIA
[ADDON] Template download + statistics (sNews 1.4)
« Reply #22 on: December 14, 2006, 12:43:54 am »

Perhaps it is worthwhile add a link to this mod in the 1.5 Mods forum?  :D
Logged
my apologies to the sNews crew, but I will be MIA for the forseeable future
Pages: 1 [2]