Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,193,949 members, 7,952,831 topics. Date: Thursday, 19 September 2024 at 04:46 AM

Using *Dreamweaver* (webdesign) - Webmasters (2) - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Using *Dreamweaver* (webdesign) (4060 Views)

How To Design A Professional Website Using Dreamweaver / Creating Complex / Advanced Search Forms With Sql Queries In Dreamweaver / Creating Dynamic Pages Using Dreamweaver/php/mysql/asp/access (2) (3) (4)

(1) (2) (Reply) (Go Down)

Re: Using *Dreamweaver* (webdesign) by Nobody: 12:56pm On May 10, 2009
@Ruudie,
I guess you have already solved your problem from your post
RuuDie:

well. . . u try but e be like sey u no dig wetin i dey yarn.

na like dis; wen d page load, if you get pic 4 database load the pic. . . if pic no dey, load a default pic, u dig?

if(returnedResult){
//code to display database returned image
$var= "<img src='result.jpg'>";
}
else{
//code to display default image
$var= "<img src='default.jpg'>";
}


then use $var where needed
thats php though. and am sure u can achieve that with asp
Re: Using *Dreamweaver* (webdesign) by ztyle(m): 12:34am On May 11, 2009
Woa! wat a thread, i will learn from here, wayback thread! grin
Re: Using *Dreamweaver* (webdesign) by biggjoe(m): 11:42am On May 12, 2009
@rudie,

If you have not solved your Show default pic wahala using dreamweaver holla me.

I used to think that things like that arent possible with DW until I learnt to edit the DW 'show region server behaviour codes'.

That will do the magic for you.

I will come back shortly and see if I can put you through with working dreamweaver codes,

A minute plz,
Re: Using *Dreamweaver* (webdesign) by biggjoe(m): 12:57pm On May 12, 2009
I said I will be back in a minute but  its almost an hour, I think I underestimated what it takes to prepare a tutorial.

Before I start, I need to add here that there are other ways of doing this but I will stick to Dreamweaver, afterall thats what the topic suggests.

I will assume that:

1. you know how to create recordsets in dreamweaver and,
2. you know how to display image from the recordset. (displaying image is different from displaying other data in DW)
3.you are not a slowpoke. grin

Let me help a bit with displaying image assuming you have created a recordset for returning it.

We assume that
1. the recodset you created is named: 'rspics' without the quotes.
2. the database field which holds the name of your uploaded files is named: 'filename' again without the quotes.
3. the picture was uploaded to a folder named 'filesgrin (no more quotes blah blah blah unless you are a retard. grin)

Go to 'Insert' >> 'Image'
On the dialogue box that pops up check the 'Data Sources' and your recordset(s) will appear inside the dialogu box.

Expand the recordset which holds your pic and locate the the field that holds the filename.
Click on the filename field and click OK,
There it is, the code for your Picture will be inserted into your cursor position.

The code that will appear asumming you are using the previously mentioned rescordset name will be:

code1:
<img src="<?php echo $row_rspics['filename']; ?>"

The code above returns the picture as if it resides in your main web folder but that is not likely. (who does a stpid thing like that anyway)
Now you have to make the code link the full path of the image which we have agreed was uploaded to the folder named 'files'
go to the code1 above and add " files/ " to make it become code2 below:

code2:
<img src="files/<?php echo $row_rspics['filename']; ?>"

If you have a picture file in that folder that is referenced in the Databse with the 'filename' then  you have displayed your image!  Run your page on a live apache server if you doubt me. i think I deserve a bottle of Gulder for this  grin

Now dont get excited, you only displayed a picture, any PHP fool can do that.

Showing and Hiding the image under certain Conditions

This is the fun part.
This is where the Dreamweaver Sho/Hide Region Server Behaviour comes handy (after editing the original DW code  of course)

Lesson Continued,

If you switch to Design View of your Dreamweaver, you will see what they call image placeholder in place of the code for displaying image. Common sense name abi?
Now use your mouse and select this image placeholder and while it is still highlighted,
Go to ' Application' pane on your far right of DW window, Click on the Server behaviour Tab and click on the + button>>
Go to 'Show region' >> 'Show if recordset is not empty' at this point, a small dialogue box opens showing you the list of your created recordsets. Select your image recordset which in this case is rspics.

When you have clicked ok, DW will pum in the following codes (code3) before and after code2. Code1 will sit in between the two lines of code below.

Code3:
<?php if ($totalRows_rspics > 0) { // Show if recordset not empty ?>

<?php } // Show if recordset not empty ?>


when you place code2: inside them you have:
code4:
<?php if ($totalRows_rspics > 0) { // Show if recordset not empty ?>

<img src="files/<?php echo $row_rspics['filename']; ?>"

<?php } // Show if recordset not empty ?>


We now have to tell the code to obey us and not DW authors ( it feels nice to know you can actually do that)

We now edit code4: and we will have:

Code5:

<?php if ($row_rspics['filename'] != ' ') { // Show if recordset not empty ?>

<img src="files/<?php echo $row_rspics['filename']; ?>"

<?php } // Show if recordset not empty ?>

We have just told PHP or is it apache to
show the picture if (the database field filename is not equal to empty)

That is to say that the picture must be shown as long as there is a text inside the filename field.
This can get tricky if you have designed your database to takee a default text when nothing was inserted to it.
But I hope you wouldnt,


How to Display a Default Image when the field is Empty

This is getting too long so let me continue in another post,
Re: Using *Dreamweaver* (webdesign) by biggjoe(m): 1:23pm On May 12, 2009
How to Display a Default Image when the field is Empty
Now to do this, I employ simple logic which is what every programming is all about.

To achieve it, I actually place the default picture or text just beside the image placeholder that returns the database pic and then instruct Apache to show it when the 'filename' database field is empty.

Does that make sense?

Let me come again, the default picture will be just side by side with the main picture but I will use the show/hide region behaviour to hide it any time the filename field has a text inside it.

I will do something similar to what I did before but first I will insert default image or text into the DW page and then highlight it (highlight only the default picture or text)

Now,
Go to 'Show region' >> 'Show if recordset is empty' at this point, a small dialogue box opens again showing you the list of your created recordsets. Select your image recordset which is still rspics.

When you have clicked ok, DW will pump in the following codes (code6) before and after the default image or text. The default image or text will sit in between the two lines of code below.

Code6:
<?php if ($totalRows_rspics == 0) { // Show if recordset empty ?>

<?php } // Show if recordset empty ?>


when you place the default image or text inside them you have:
code7:
<?php if ($totalRows_rspics == 0) { // Show if recordset empty ?>

"Default Image or text"

<?php } // Show if recordset empty ?>


We now have to tell the code to ignore DW authors ( yet again!! super we!!)

We now edit code7: and we will have:

Code8:

<?php if ($row_rspics['filename'] == ' ') { // Show if recordset empty ?>

"Default Image or text"

<?php } // Show if recordset empty ?>


Thats it!! We have now given the page enough powers to show the DB image when you have something inside the database filename field and again show the default image or text when nothing is inside it.

Thats how I did It. This could be subject to malfunction if your database field was designed to have default text.

I think I have to stop here for now.

Hmm na waa ooo.
Re: Using *Dreamweaver* (webdesign) by biggjoe(m): 6:58pm On May 13, 2009
Re: Using *Dreamweaver* (webdesign) by neonseinsoppy(m): 11:09am On Sep 01, 2011
So I've been looking around the net and have come to the conclusion that it's hard to find someone to do good

SEO Work! It just plain is! But I did stumble upon a gentlmen that really knows his stuff and got my site to a page

rank 3 in one month! He's great! Check him out I think you will be suprised. Why am I sharing? Because This Forum

KICKS ASS!! Ha ha enough said! Try him out you won't be dissapointed.

backlinks building
Re: Using *Dreamweaver* (webdesign) by just4just: 2:43pm On Sep 07, 2011
let sombody tell me how i can export easily from fireworks into my dreamwaver, this give me slow movement.
Re: Using *Dreamweaver* (webdesign) by BALLERON(m): 12:02pm On Sep 08, 2011
i have macbook pro with the config below for sale
  -----intel core duo 2.4ghz
  -----200gb , 4gb RAM , dvd rw, bluetooth, wifi.
  -----Apple Mac OS-X 10.6.4
        etc
        the macbook is in a good condition
        price -----160k
        please email -----nostrodamus9210@yahoo.com
         
Re: Using *Dreamweaver* (webdesign) by BALLERON(m): 7:14am On Sep 09, 2011
i have macbook pro with the config below for sale
  -----intel core duo 2.4ghz
  -----200gb , 4gb RAM , dvd rw, bluetooth, wifi.
  -----Apple Mac OS-X 10.6.4
        etc
        the macbook is in a good condition
        price -----160k
        please email -----nostrodamus9210@yahoo.com
       
Re: Using *Dreamweaver* (webdesign) by BALLERON(m): 9:21am On Sep 21, 2011
i have macbook pro with the config below for sale
  -----intel core duo 2.4ghz
  -----200gb , 4gb RAM , dvd rw, bluetooth, wifi.
  -----Apple Mac OS-X 10.6.4
        etc
        the macbook is in a good condition
        price -----130k
        please email -----nostrodamus9210@yahoo.com

(1) (2) (Reply)

How To Open A Paypal Account In Nigeria / Freelance Website Designer / Secrets In Making Money Online And Making A Living From The Internet

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 35
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.