Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2003
    Location
    Memphis, TN, USA
    Posts
    61

    Exclamation Unanswered: changing picture with hyperlinks

    hi there !!

    I want to do something like this..

    I am generating one report which contain few images..what i want to do is.. if user click on one particular picture.. next time the picture will replace with new picture and new hyperlink. How i can do it ?

    Please suggest !!

    With thanks

  2. #2
    Join Date
    Jan 2004
    Posts
    3

    Re: changing picture with hyperlinks

    There are two ways
    1. serverside scripting e.g. php, asp: Generate a .asp or .php page with a picture. If the picture is clicked the same page must be requested but with a parameter that refers to the next picture. The parameter must be handled by the asp or php module webserver.
    2. client side scripting: Make a page that contains the pictures. Make all pictures but one hidden. Write a javascriptprocedure that hides the current picture and shows the next. Call this procedure in the onclick event of the picture.

    Originally posted by sqlboy
    hi there !!

    I want to do something like this..

    I am generating one report which contain few images..what i want to do is.. if user click on one particular picture.. next time the picture will replace with new picture and new hyperlink. How i can do it ?

    Please suggest !!

    With thanks

  3. #3
    Join Date
    Mar 2003
    Location
    Memphis, TN, USA
    Posts
    61
    Thanks for your reply.. !!

    I was getting little bit from your response. Would you like to eloborate a little more ? Please !!!

    I am using ASP and SQL Server 2000. I am fetching the records from one sql table..

    Hope this time, i am bit clearer..

    With thanks

  4. #4
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    Say you want a 5x5 grid of images;

    Code:
    SELECT * FROM images WHERE id<>3 LIMIT 20
    LIMIT may be TOP or something in M$SQL... but I can't remeber

    Right anyway,


    each image should have a link to whereever - but - tag on the end of it something like this
    Code:
    &img_id=3
    (obviously replacing 3 with the value from the id column for the current row).

    whatever page the user links to needs to keep that paramenter in the querystring (asp)/get variables (php) for when the user navigates back to the image grid page.

    Now, in the query from eariler you need to change 3 to the value of that parmeter.

    Summary (psuedo code)
    Code:
    check for img_id parameter, if not found set to -1
    get a record set containing all records except any with an id=to img_id paremeter (limiting to 20 records)
    display the images (making sure the links have a img_id parameter in)
    Hope that makes sense, it was typed in a rush

  5. #5
    Join Date
    Mar 2003
    Location
    Memphis, TN, USA
    Posts
    61
    Thanks !! You eloborated it quite nicely.. and I got it quite clearly what i have to do.. Thanks !!

    There is one more issue related to image hyperlink.. I was making one report named "review report" .. What i want in it is.. as soon as the user clicks on the particular records ( i mean to say.. when he/she viewed it) the image associated with that record will replace with new image..

    In any of mine tables no such fields are there which store such status.. wether the records has been reviewed or not ? If i have to go thru that method then please explain.. How i can do it ?????

    Are there some other method also thru which i can do it ?

    With thanks !!

  6. #6
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    Not quite sure what you mean but here it goes;

    You can store a list of what the user has viewed in either the session variables or a cookie or such like. Remeber sessions/cookies can be "lost" (deleted/cleared/ended by the user) - so keeping it in the database (or a file or such like) may be your only option if you need to keep a track of what they have viewed.

    This is pretty easy to do, but could have a performance hit if your constantly saving lots of data.

  7. #7
    Join Date
    Mar 2003
    Location
    Memphis, TN, USA
    Posts
    61
    It seems you are not getting what i seek... let me explain again..

    I have to make one report in which all the events related to particular campaigns are going to display.. Every record has one picture which gives the idea whether someone view that record or not... In order to view the details of events user has to click on the graphic icon associated with that record..

    Now, I want to keep whether records has been viewed by someone or not.. if it was views then i have to display other pciture..

    Hope this time, I explained well...

    With thanks !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •