Jump to content
  • 0

Закругление углов картинок в топ 10 (DLE)


Pro100User
 Share

Question

Подскажите как сделать закругленные углы у картинок в топ 10 новостей (DLE 9.5)

Скрипт модуля

<?php 
$sql_result = $db->query( "SELECT id, title, date, alt_name, category, short_story, flag FROM " . PREFIX . "_post WHERE approve='1' ORDER BY rating DESC LIMIT 0,10" );
while ( $row = $db->get_row()){$row['date'] = strtotime( $row['date'] );
$row['category'] = intval( $row['category'] );
if( $config['allow_alt_url'] == "yes")
{
if( $row['flag'] and $config['seo_type'])
{
if( $row['category'] and $config['seo_type'] == 2 )
{
$full_link = $config['http_home_url'] . get_url( $row['category'] ) . "/" . $row['id'] . "-" . $row['alt_name'] . ".html";
}
else{$full_link = $config['http_home_url'] . $row['id'] . "-" . $row['alt_name'] . ".html";
}
}
else
{
$full_link = $config['http_home_url'] . date( 'Y/m/d/', $row['date'] ) . $row['alt_name'] . ".html";
}
}
else{$full_link = $config['http_home_url'] . "index.php?newsid=" . $row['id'];
}
$title = substr( $row['title'], 0, 200 ) . "...";$short_story = substr( strip_tags($row['short_story']), 0, 0 )."...";

$shortnews = $row['short_story'];

preg_match_all( '#<img[^>]*\\ssrc=(\'|")(.*?)\\1.*?>#i',$shortnews,$total);

foreach( $total[2] as $image )

echo('

<a class="tooltip" href="'.$full_link.'" ><img align="center" src="'.$image.'" width="97" height="133" ><span>'.$title.'<small></small></span></a>')

;}
?>

CSS


.tooltip { position: relative;}

.tooltip span {
position: absolute;
left: 0;
top: -80px;
display: none;

padding: 3px 8px;
white-space: nowrap;
font-size: 14px;
font-weight:500;
text-align: right;
background-color: #CCCCCA;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
color: #000;
border: 1px solid #FFAD33;
}
.tooltip span small {
position: absolute;
right: 10px;
bottom: -6px;
border-top: 6px solid rgba(0,0,0,.8);
border-left: 6px solid transparent;
}
.tooltip:hover span { display: block;
}

h_1329930698_7509421_39d452b24f.png

Или может border закругленный сделать, тока как для каждой картинки???

Edited by Pro100User
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy