Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: Problem to enlarge the size of the image in method "featuredcontentslider"  (Read 3752 times)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca

Why we will add  field in the Article panel for entering an image url  .I think that the way in which I have mentioned in your article something difficult. Because you need to modify the file snews.php ...The other hand I just want to be a photo as the title of the article can be pressed  ....I have mentioned in your article I think that there are many other touched Can you tell us one of the easy way. ....Can we include this code in a file contentdiv.css or style.css

.contentdiv img {display:block; a href="'.db('website').$v['catSEF'].'/'.$v['artSEF'].'/"; width:430px; hight:320px; margin:XXpx 0;}

What I want to say is that we'll CONNECT hyperlink to the image located in the method (featured content slider)
only to remind  i have snews1.6

No... you cannot put any incomplete HTML or any PHP code in any CSS file. Well, that's not entirely true... you CAN... but it will not work.
Cascading Style Sheet files are only used for CSS styling declarations... nothing else.

You cannot publish an article with a title and have the title linked to an image... because the script that generates the title is dynamically generated using data stored in the database....... the article's seftitle (from the articles table and the category's seftitle from the categories table.

sNews is designed to publish articles... or pages... and you can put an image in an article's content.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal

Quote
.contentdiv img {display:block; a href="'.db('website').$v['catSEF'].'/'.$v['artSEF'].'/"; width:430px; hight:320px; margin:XXpx 0;}

This is an unusable css construction, a href="" is an html value, not a css value. Simply put, you can't do it that way. Also, the "XXpx" in margin should be replaced with a numerical value that works in your design. XX was used before as a placeholder since I have no way of knowing what value your design actually needs.

I think you need to read up on HTML and CSS, what elements you can and can't use in each, before attempting the change you're trying to accomplish.

Also, as I said before, I haven't used the featured content slider mod so I don't really have anything to add other than what I've already suggested.
Logged

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .



I think you need to read up on HTML and CSS, what elements you can and can't use in each, before attempting the change you're trying to accomplish.


Thank you ... I know it can not be merged code php with file css

But I was the oldest proposal ...In the file style.css We could do the inclusion of the background img ...So I said in the same Can we do "a herf" to img in file css

In terms of what I have said I should read in php & css . I tell you I am a specialist in language php & c++ . But the language css .I do not know very well, but I think its easy.   thanks again
« Last Edit: August 24, 2010, 11:00:02 PM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”

nukpana

  • Hero Member
  • *****
  • Karma: 71
  • Posts: 663

I am so confused as to what you want to do. Can you write some psuedo code as to what you want done or write/ask the request clearer?

I assume you now want either:

Code: [Select]
// HTML
<a class="articleLink" href="path/to/article">Article</a>

// CSS
.articleLink { background-image:url('path/to/image.png'); }

Or
Code: [Select]
<a class="articleLink" href="path/to/article"><img src="path/to/image.png" /></a>
Please confirm back.
Logged

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .

I want such a model...See .condentdiv img / It's just a picture that displays in class name "contentdiv" in  method  (Featured Content Slide)

<a  href="path/to/article"><img src="#condentdiv img" /></a>

What do I need it /

<a href="'.db('website').$v['catSEF'].'/'.$v['artSEF'].'/">
         <p align="center">contentdiv img</p>
         </a

Seen in    

 // CSS
.articleLink { background-image:url('path/to/image.png'); }

Could it be that like this

 // CSS
.articleLink { a herf image:url('path/to/article/'); }

« Last Edit: August 25, 2010, 06:43:56 PM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca

1)  Do you want a background image on the article title?
Or...
2)  Do you want the title link to show an image when clicked?

1)  The only thing you can do in CSS is apply a background image to a class.
     Example: If you have an image in the root/images folder, and you want a background image in a division class, you would use:
        .condentdiv { background-image: url(images/name-of-image.jpg); }

2) If you want the title of an article linked to an image so it shows an image when you click the title,
   you would need to modify the title string in function center() in the snews.php file to add an image to it.
   Example:

In your snews.php file (sNews 1.6), search for this string:
   if ($r['displaytitle'] == 'YES')

Under it, you will see this string:
Code: [Select]
<?php

echo '<h2>'.(strlen($text) > $shorten $link.$category.'/'.$r['seftitle'].'/" title="'.$title.'">'.$title.'</a>' $title).'</h2>';

?>


To link an image to the title, you would copy the string, paste it under the existing one and modify it like so:
Code: [Select]
<?php

# DEFAULT STRING - not changed
// echo '<h2>'.(strlen($text) > $shorten ? $link.$category.'/'.$r['seftitle'].'/" title="'.$title.'">'.$title.'</a>' : $title).'</h2>';

# MODIFIED STRING WITH TITLE LINKED TO AN IMAGE
echo '<h2>'.$link.'images/image-name.gif" title="IMAGE-NAME">'.$title.'</a></h2>';

?>


NOTE: the modified string will be hot-linked at all times, whether the article is shortened or full-length.
 
 
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .

1)  Do you want a ...............................?
Or...
2)  Do you want ...................................?
 

Actually i want the image of an article linked to an article text so it shows an text of article when you click the image,

I just want to remind that I want to serve that property in "dynamic drive script"
http://snewscms.com/forum/index.php?topic=8858.0
« Last Edit: August 25, 2010, 10:45:20 PM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”

nukpana

  • Hero Member
  • *****
  • Karma: 71
  • Posts: 663

I want such a model...See .condentdiv img / It's just a picture that displays in class name "contentdiv" in  method  (Featured Content Slide)
Code: [Select]
<a href="path/to/article"><img src="#condentdiv img" /></a>What do I need it /
Code: [Select]
<a href="'.db('website').$v['catSEF'].'/'.$v['artSEF'].'/"><p align="center">contentdiv img</p></a>Seen in    
Code: [Select]
// CSS
.articleLink { background-image:url('path/to/image.png'); }
Could it be that like this
Code: [Select]
// CSS
.articleLink { a herf image:url('path/to/article/'); }


Well, you can have the Image noted in the HTML or in the CSS, not both , that's why I gave two options.

So this:
Code: [Select]
<a href="path/to/article"><img src="#condentdiv img" /></a>
Code: [Select]
<a href="'.db('website').$v['catSEF'].'/'.$v['artSEF'].'/"><p align="center">contentdiv img</p></a>

Would be:  (contentdiv would be unique so I am making it an ID)
Code: [Select]
<a href="path/to/article"><span id="articleName_img" class="intro_img"></span></a>The CSS then would be:
Code: [Select]
#articleOne_img { background-image: url(path/to/articleOne_img); }
#articleTwo_img { background-image: url(path/to/articleTwo_img); }
.intro_img { align: center; }

The CSS ID is unique, whereas the CSS CLASS can be applied to more than one item. 
« Last Edit: August 26, 2010, 02:07:17 PM by nukpana »
Logged

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .

What you say is true ... But I want to be an impact on the image automatically .
Means that we must deal with php tags ... If you want the easy way and the manual I would have done it manually
 I'm going to insert the code in each article :

Code: [Select]
<a href="http://xxxx.com/xxxx/xxxxxxxxxxx">
<img border="0" src="http://i.imagehost.org/0920/4_40.jpg" width="200" height="150">
</a>
But I want this to be done automatically, so I Want to put only:

Code: [Select]
<img border="0" src="http://i.imagehost.org/0920/4_40.jpg" width="200" height="150">
I have already the view of many sites use this feature
Unfortunately for the inconvenience
Logged
“Fifty years of programming language research, and we end up with C++?”

nukpana

  • Hero Member
  • *****
  • Karma: 71
  • Posts: 663

Same thing then, just remember to keep the name consistency

Code: [Select]
<a href="' . db('website') . $v['catSEF'] . '/' . $v['artSEF'] . '/">
   <img src="' . $v['artSEF'] . '_img" id="' . $v['artSEF'] . '_img" class="intro_img" />
</a>

The CSS then would be:
Code: [Select]
#articleOne_img { special styles here }
#articleTwo_img { special styles here }
.intro_img { border: 0; width: 200; height: 150 }
Logged

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .

 :( :(
« Last Edit: April 15, 2012, 05:05:33 PM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”

nukpana

  • Hero Member
  • *****
  • Karma: 71
  • Posts: 663

It was just an example in the (rare) event, you knew you always would have an image with the article, that the image would be linked to the article, with a naming convention - "articleName_img" or $var['articleSEF'].'_img'.  Again, an example of pseudo code, nothing more.

Your image is not clickable because it is not wrapped in the href tag.
Code: [Select]
<a href="'.db('website').$v['catSEF'].'/'.$v['artSEF'].'/">
<img src="path/to/your/img.jpg" />
</a>
<p class="latest-text">'. $v['text'] .'</p>
Does that clear it up better?
Logged

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .

Very nice ... Let me just want to say that I want to be so :


<a href="'.db('website').$v['catSEF'].'/'.$v['artSEF'].'/">
   <img src="All images displayed in the method(featured content slider)" />
</a>
<p class="latest-text">'. $v['text'] .'</p>


You give me the right way, but when I want to do I change my image I have to edit a file index.php to change source of image. But I want to change it just from control panel.
« Last Edit: August 27, 2010, 10:56:53 PM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”

nukpana

  • Hero Member
  • *****
  • Karma: 71
  • Posts: 663

Which is why you either need to do some hacking (you noted you are good w/ PHP)

OR have some way to access the images through the system - as stated, for example - articleSEF_img.jpg or whatever so you can do this:

Code: [Select]
<a href="'.db('website').$v['catSEF'].'/'.$v['artSEF'].'/">
   <img src="'.$v['artSEF'].'_img.jpg" />
</a>
Logged
Pages: 1 [2]