Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Multiple images
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Webbo
Average Member

United Kingdom
982 Posts

Posted - 16 July 2013 :  17:01:33  Show Profile  Visit Webbo's Homepage  Reply with Quote
Is there a way of showing multiple numbers of the same image other than writing <img src = ""blahdeblah.gif""> numerous times?

In other words something like: < display""x5"" img src = ""blahdeblah.gif"">
to show the blahdeblah.gif 5 times

Thanks,

Edited by - Webbo on 16 July 2013 17:03:05

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 17 July 2013 :  02:20:41  Show Profile  Reply with Quote
Easy.

To do it with a function:


Save this in "inc_func_common.asp":

Function M_Image(intQty,strMImage)
	For intMI=1 to intQty
		Response.Write	"<img src=""" & strImageURL & "&strMImage&"" />"
	Next
End Function

Call the function in your code like this:

M_Image(5,"blahdeblah.gif")


Otherwise, to do it on a single occasion:


For intMI=1 to 5
	Response.Write	"<img src=""" & strImageURL & "blahdeblah.gif"" />"
Next


Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 17 July 2013 :  02:30:13  Show Profile  Visit Webbo's Homepage  Reply with Quote
Amazing

Thanks Carefree I'll give it a go later
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 17 July 2013 :  09:49:42  Show Profile  Visit bobby131313's Homepage  Reply with Quote
I'm curious why you would want to do this.

I fight with my members that post long lines of smilies. I actually have my bad word filter set up to fight it.

Switch the order of your title tags
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 17 July 2013 :  10:02:01  Show Profile  Visit AnonJr's Homepage  Reply with Quote
quote:
Originally posted by bobby131313

I'm curious why you would want to do this.


Ditto. This sounds an awful lot like asking if I should hammer a nail with an old shoe or a glass bottle...
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 17 July 2013 :  15:35:40  Show Profile  Visit Webbo's Homepage  Reply with Quote
The reason I asked was a long standing member of our forums recently asked if he could have a different coloured set of stars under his name than the ones we were using for normal members.
As this member has been good to us I decided it was a small request that I could/should honor and so coded it into topics.asp so that it looked up his member ID when posting and replying to topics and if it was such then to display five gold stars instead of the set blue ones.

The thought occured to me afterwards, hence my question, if it was possible to code for multiple instances of the same image rather than repeating the img src code five times

More from a curiosity perspective than a requirement
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 17 July 2013 :  15:49:39  Show Profile  Visit HuwR's Homepage  Reply with Quote
This can also be done using a single image, set it as the background to a div, set the background to repeat and set the div to the width you need to display x number of stars

Example

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 17 July 2013 :  19:09:56  Show Profile  Visit AnonJr's Homepage  Reply with Quote
Well that actually makes sense.
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 18 July 2013 :  13:29:26  Show Profile  Visit Webbo's Homepage  Reply with Quote
Having just reread this and HuwR's reply I just realised that if I made the single image into a larger image of 5 stars and called it for example bladeblah5.gif, I'd only have to add the image code once anyway lol

What's that about thinking too deep ?
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 18 July 2013 :  21:47:32  Show Profile  Reply with Quote
As long as the image is not animated, that would be the easiest solution.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000 Version 3.4.07