floatingDivs 21 Junior Poster

Apologies for the broken code. I fixed it in my Terminal, but because of my incompetence (not knowing how to CUT out an entire "file" *facepalm*) I was forced to rewrite a quoted copy of your code and forgot to fix the issue on line 53.

floatingDivs 21 Junior Poster

@VernonDozier,

Thanks so much for that link. When I installed Linux, I forgot to backup my bookmarks and lost that page. Cookie for you, bro.

@destroyer89100,

Do you enjoy programming? That's a relatively simple problem and the fact that you don't want to put the (small) amount of time necessary to do a good job makes me think you're not all that into it.

floatingDivs 21 Junior Poster

Make sure to close the <a> tag. The one you posted above isn't closed.

Also, consider span tags inside the <a> tags because some clients otherwise default to their skin colors. For instance, gMail (I think) causes all links to stay blue even if you inline-style a different color UNLESS a span is inside the a tag.

floatingDivs 21 Junior Poster

This should give you a pretty good answer.

Constructors

Destructors

floatingDivs 21 Junior Poster

where did you define MAX?

He defined it in main, but he's not passing it as a parameter for any of his functions. Either define the variable as a global variable (not recommended as a habit) or pass the value as a parameter in your functions.

--EDIT--

I got your program compiling and it *appears* to work, but as for the acutal correctness of the code, not sure. I didn't bother to look through any of it, just moved the constant integer MAX outside the main function and turned it into a global variable.

#include <iostream>

using namespace std;

// Functions 
void initialize(int *list, int &count);
int *duplicate(int *list, int count);
void display(int *list, int count);
double average(int *list, int count);

const int MAX = 100;  // global variable

// Main Program 
int main()
{
   int list1[MAX];
   int *list2;
   int count;
   initialize(list1, count);
   list2 = duplicate(list1, count);
   cout << "Original List:\n";
   display(list1, count);
   cout << "Duplicate List:\n";
   display(list2, count);
   cout << "Average: " << average(list1, count) << endl;
   return 0;   
}

// Function Definitions 
void initialize(int *list, int &count)
{
    const int SENTINEL = -1;
    int num; 
    
    count = 0; 
    cout << "Please enter integers (-1 to quit). ";
    cin >> num; 
    cout << endl; 
    
    while(num != SENTINEL)
    {
        list[count] = num; 
        count++;
        cin >> num; 
    }
}

// Duplicate Array
int *duplicate(int *list, int count)
{
    int *dup;
    
    dup = new int list[MAX]; 
    
    for(int i = 0; i < count; i++)
    {
        dup[i] = list[i]; 
    } …
floatingDivs 21 Junior Poster

Carefully read this and be 100% certain before ruling it out.

http://www.webmasterworld.com/firefox_browser/3035057.htm

---

EDIT: Here's a working version I re-created on my desktop. Copy & paste this into a test page and try it out. If it works, maybe consider using the absolute links I did rather than relative ones? Also, curious as to why your charset isn't UTF-8.

---

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Latmontu Kontakti | www.latmont.org</title>
<link rel="stylesheet" type="text/css" href="http://latmont.org/style.css" />
</head>

<body>

<div id="container">

<div id="header">
<h1>Latmontu Kontakti</h1>
<h2>www.latmont.org</h2>

</div>

<div id="linkbar">
<div id="navcontainer">
<ul id="navlist">
<li id="active"><a href="index.htm" id="current">Mājas Lapa</a></li>
<li><a href="laikradis.htm">Laikrādis</a></li>
<li><a href="jaunumi.htm">Jaunumi</a></li>
<li><a href="notikumi.htm">Notikumi</a></li>
<li><a href="saites.htm">Saites</a></li>
<li><a href="kontakti.htm">Kontakti</a></li>

<li><a href="atbalss.htm">Atbalss</a></li>
</ul>
</div>
</div>

<div id="left">

<div id="sub_left">
<h3>Latvijas Republikas Vēstniecība Kanādā</h3>
<p align=middle><img src="http://latmont.org/images/mini-saulite.png" alt="Saulite" width="78" height="80" class="img_left" /></a> </p>
<b>Pasta adrese:</b><br>
350, Sparks Street<br>

Suite 1200<br>
Ottawa, On. K1R 7S8<br>
<b>Tel:</b> 613-238- 6014<br>
<b>Fax:</b> 613-238 7044<br>
<b>Epasts:</b> <a href="mailto:embassy.canada@mfa.gov.lv">embassy.canada@mfa.gov.lv</a><br>
<b>Saite:</b><br>

<a href="http://www.ottawa.am.gov.lv/lv/">http://www.ottawa.am.gov.lv/lv/</a> </p>
<hr>
<br>
<h3>Latvijas Valsts Goda Konsuls Montreālā</h3>
<p><img src="http://latmont.org/images/mini-saulite.png" alt="Saulite" width="78" height="80" class="img_left" /><b>Kontakts:</b><br>
Roberts Klaiše<br><br>
<b>Pasta adrese:</b><br>
3955 Provost, Lachine, Que. <br>
H8T 1M1<br>

<b>Tel:</b> 514-422-0562<br>
<b>Epasts:</b> <a href="mailto:rklaise@sympatico.ca">rklaise@sympatico.ca</a> 
</p>
</div>

<div id="sub_right">
<h3>Montreālas Latviešu Katoļu Kopa</h3>
<p><img src="http://latmont.org/images/mini-saulite.png" alt="Saulite" width="78" height="80" class="img_left" /></a> </p>
<p><b>Kontakts:</b><br> Alberts Caune<br>

<b>Tel:</b> 514-484-0272</p> 
<p><i>Dievkalpojumi notiek Notre Dame Bazilikas Sv. Jēzus Sirds kaplīčā, ieeja no St. Sulpice ielas.</i> …
sasa.spurmanis commented: thanks FD! You helped me solve this problem :D +0
floatingDivs 21 Junior Poster

Are you sure you didn't invert the slashes?

<a href="//Server/folder">Click Here</a>

Also, you should probably be using double-quotes instead of single-quotes.

floatingDivs 21 Junior Poster

ankit.pandey3,

You're missing a DOCTYPE declaration. You HAVE to have a declared DOCTYPE, otherwise all kinds of funky things happen in browsers. Put this AT THE TOP of the page (above the <html> tag):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

---EDIT---

Also, from now on, try to use this "template" when designing pages so errors like these don't happen. Notice how a DOCTYPE (as well as XMLNS attribute are used? Good standards = good pages.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

</head>
<body>

</body>
</html>
floatingDivs 21 Junior Poster

Silly question, but if this is a hard-coded site, would you be up for using external services?

For instance, http://roundpic.com/ is a fantastic option because all you do is upload an image and specify the rounded-pixel size as well as which sides.

floatingDivs 21 Junior Poster

@shaya4207

Yeah, that didn't actually work. I had edited my post (twice!) but neither of them took effect?

@sasaspurmanis

After digging around a little bit yesterday, I found out that there might exist a possibility that your server isn't setup properly. Do you know what an .htaccess file is? You may need to insert the following snippet of code into it.

AddType text/css .css
floatingDivs 21 Junior Poster

After I changed your charset to UTF-8, everything looked better...

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

floatingDivs 21 Junior Poster

Might have something to do with line 30.

generator.document.write('<html><head><title>Math Challenge!</title></head><body>');

Try to remove that and see if it fixes that. You've already generated a majority of those tags above the JavaScript.

EDIT: Also try to remove the following line right above the the one above:

var generator=window.open('',
                             'name',
                             'width=400,height=100,toolbar=0,scrollbars=0,screenX=200,screenY=200,left=200,top=200');

It might be a broken function since it's on multiple lines. I'm going off guesses, but maybe double-quotes have to be used for multi-line, non-breaking JS. More than likely, though, it's the second (EDIT) code because JavaScript breaks if you use return keys in functions like that.

EDIT2: Actually, I copied & pasted your uploaded source code (from live site) into a file and it has different code. Are you sure you uploaded the code you pasted into this thread into the correct live location?

floatingDivs 21 Junior Poster

Title: IFRAME issue
Answer: IFRAME

May I ask why you are using an iFrame? They're not even valid HTML anymore, I believe.

As for the problem, it's because the iFrame can only be as tall as the container it's "wrapped" in. So, let's say this is your layout:

<div id="iframe-wrapper">
   <iframe goes here...>
</div>

Whatever you set the height of the "iframe-wrapper" is the height that will be available for the iFrame.

Also, Kraii answered it first (and better probably).

floatingDivs 21 Junior Poster

No prob. 4 *&%%^ HOURS to get 6 lines of code!, I'm sure I'll be bald by the end of this week. Funny enough, I had a breeze with MySql into all different pages. vb6 is just soooo much easier, or until I have this under foot at least.;)

AndreRet,

Glad to hear that you solved your problem!

I'm not sure how knowledgeable you are with Web Development, seeing how you mentioned VB was more your style, but may I suggest that you use titles more descriptive and closer to your goal? For instance, "Determine previous page click event" sounds a lot like JavaScript, right? Especially the part about "click event", which tends to be associated with JavaScript (at least to me). A title like "Determine previous page via query string" would be much closer to what you seek. Although, if you don't know about query strings, my point is moot.

I've spent the last 5 minutes thinking of whether to post this or not, simply because it SOUNDS like a jackass comment, but it's not meant to be, honest! I skipped over it for quite a while thinking it was a JavaScript issue, not a PHP one.

Not meant to be critical, promise...

AndreRet commented: Thanks.:) +7
floatingDivs 21 Junior Poster

Remove the PHP echo for the DOCTYPE, and everything above the <head> tag. See what happens...I have a feeling that's your problem. If I recall, DOCTYPE is read-only and shouldn't be outputted like that.

floatingDivs 21 Junior Poster

Hey shawtyred74,

Your second code isn't properly wrapped in code tags. The problem is the opening brace to the ending code wrapper.

Instead of [/CODE], you have /CODE]

floatingDivs 21 Junior Poster

Shouldn't it be

$row = mysql_num_rows($result)

instead of

$row = mysql_fetch_array($result)

floatingDivs 21 Junior Poster

How do I go about coding a website design I just created in PhotoShop? Right now it's a PSD file so how do I turn it into a website now?

No, I don't have Adobe Fireworks, so I can't use that.

Well, you've created an image of what you wish your site to look like, right? You've added text, search area, etc. To "convert" it into a web site, slice up the images you wish to use. Design a text page using divs, paragraphs, etc. Then, set the sliced images as background-images or use them as img tags.

floatingDivs 21 Junior Poster

Hey whimsical1987,

I took a look at your code. There are two ways to go about doing this. The first would be to set a larger height on the #header when the login form is turned on. That may not be a smart idea, considering a header should not be that big.

The other idea would be to move the <fieldset> and all its data (so your entire form) out of the header and into its own <div>.

EDIT BELOW: Take a look at how I've placed the fieldset in its own "area" rather than being inside the header div. Also, any CSS changes I've made have been inline-styled, so your CSS entries haven't been touched. All changes, by the way, are in the <fieldset> container.

--EDIT--

<html>
<head>
<style>
body {
	margin:0;
	padding:0;
	font:13px/16px "Lucida Grande", Arial, Sans-serif;
}

#container {
	background: #ffff;
	margin: 0 auto;
	width: 1000px;
}

#header {
	background: #ccc;
	padding: 20px;
	position:relative;
	overflow:hidden;
	clear:both;
	z-index:0;
}

#logo {
	position: relative;
	float:left;
	width:300px;
	height:70px;
	margin-top:0px;
	background-image: url(images/logo.png);	
}

#menubar {
	position:relative;
	width:1000px;
	background-color:#666;
	z-index: 2000;
	background-image: url(images/menubar.png);
	overflow: auto;
	height: 40px;
	margin-top: 2px;
}
#registerForm fieldset {
	border: 2px solid #69C;
	float: left;
	margin: 0.7em 0;
	padding: 0 2% 1.75em 18%;
	width: 80%;
	position:relative;
	background-attachment: scroll;
	background-color: #FFF;
	background-image: none;
	background-repeat: repeat;
	background-position: 0 0;
	margin-left:auto;
	margin-right:auto;
}
#registerForm {
	width:90%;
	margin-right:auto;
	margin-left:auto;
}

#tableinfo {
	float:left;
	position:relative;
	padding-top: 10px;
}
#registerForm legend {
	color: #999;
	font-size: 1em;
	left: 1em;
	line-height: …
floatingDivs 21 Junior Poster

Do you have a live test site up yet? The HTML you posted is not of much use considering the images can't be seen (empty "login" area).

From what I'm seeing in the image you posted, it appears to be a floating issue but I can't be 100% certain without seeing the live page.

Regarding your question about copyrights, I don't see why not. At least, as long as you didn't copy the Twitter login entirely.

floatingDivs 21 Junior Poster

Increase your #wrapper width.

EDIT: Consider using something like 8px of padding on the .content area of the sidebar. I tested it out with Firebug and it looked better. Right now, as you can see, the text is hitting the edge of the sidebar.

floatingDivs 21 Junior Poster

margin-left: auto;
margin-right: auto;

floatingDivs 21 Junior Poster

Hey patuie,

I see you are online and I'm going to send you a private PM.

floatingDivs 21 Junior Poster

@teedoff

Completely agree with you regarding paragraph tags being used instead of break tags. To be honest, is there ever a real need for break tags? For instance, while they can be used as "presentational" markers, what about the blind users who have to listen to Jaws or other visual-aid software speak "to the end of the monthbreakthis is how the weekly schedule..."

floatingDivs 21 Junior Poster

patuie,

You're almost there! :)

I realise this may be a private site, so if you don't feel comfortable sharing it with the entire forum, feel free to PM me. What I need is an EXACT copy of the site that you screen-printed and posted as an image. Without seeing the rest of the code, I can't really recognise where the problem is located.

floatingDivs 21 Junior Poster

Didn't work. I was wondering if it is because I don't have a code for the small images. I have it so when you hover over the image a larger one appears.

Could you post your entire page's code? Like, all the HTML and CSS? I'll take a look at it in 10-12 hours once I come home from work.

floatingDivs 21 Junior Poster

Make sure to mark your thread as solved.

floatingDivs 21 Junior Poster

Try placing a z-index on the inner UL.

.menu ul li:hover ul li:hover ul { z-index: 2; }

floatingDivs 21 Junior Poster

@FloatingDivs thx for sharing...i need more and please elaborate your code...

I'm really unsure about how much code it is you need...do you know any PHP and MySQL? If not, maybe you should pay someone to do it for you? Quite frankly, I'm not sure how much more there is to it than the advice already given to you by the posters in this thread.

You have a database. It has a table called [insert table name containing Thread Status].

For instance, database name is "MyOwnCMS". The table name is "ThreadStatus". It contains two fields: thread ID and thread Status.

For example, the fields are called TS_ID (thread ID) and TS_Status (thread status). The ID pertains to the threads ID obviously and the TS_Status pertains to whether it's locked or opened. As you can see, there are two options: locked and opened. Thus, you only need a 0 (false) or 1 (true) as your data for TS_Status.

The function I posted in my previous post is_locked() would return a 0 if the thread isn't locked and 1 if it is.

Thus, the contents of the function is_locked() would simply query the Thread ID and find its status.

floatingDivs 21 Junior Poster

how can i do that?

I would assume it could be very simple. Every time someone uploads an image, the image is put onto the "images" directory of the site. The URL the image is uploaded to "http://yoursite.com/assets/images" + "filename.filetype" is inserted into the database. Then, you can link to or generate dynamic content with an array of images.

floatingDivs 21 Junior Poster

u have an extra code 4 that issue sir?

<?php
    function is_locked()
    {
      // if locked, return 1 (true)
      // else return 0 (false)
    }

    if(is_locked())
      // display "locked thread" image
    else
       // display "open thread" image
?>
floatingDivs 21 Junior Poster

Hey guys,

I need some help in deciding whether Wordpress 3.1 is OK for full-time use. I realize it's in beta, but my mother's friend wants her static website turned into dynamic content via Wordpress. I don't mind 3.0, but I've heard really good things about 3.1, such as superior SEO. She wants to be able to put up new pages without paying her webmaster an expensive fee for each page and she will use Wordpress.

floatingDivs 21 Junior Poster

ive been looking at the <div> tag, i know how to to align it center left or right but the one thing i would like to know is how to place things side by side like put a content box and then a facebook page like button embedded beside it if you know what i mean?

I think the CSS style you want to use is float.

floatingDivs 21 Junior Poster

Tables are NOT the way to go. Learn how to create websites with divs. They'll make your life a lot easier and the troubleshooting (if there is any) will be a breeze compared to tables (in my opinion).

However, if you do decide to stick with a table layout, consider using padding and margin to "align" the bar with the navigation menu.

floatingDivs 21 Junior Poster

You can use floats, margins, and padding (along with vertical-align).

Also, post some code and people will give you pointers/hints.

floatingDivs 21 Junior Poster

hey magicmedia your suggestion worked fine. my next question is how do i display post/comments of my blog on the index page of my website. thanks.

Or you could, you know, read the documentation and find out yourself?

http://codex.wordpress.org/

You'll thank me later.

floatingDivs 21 Junior Poster

Did you create a static version of whatever it is you're trying to generate with XML/XSL? I've learned my lesson...always make sure a static (HTML) copy works in all browsers before attempting to create it with XML/XSL.

Paste your XML and XSL (separately...obviously) and I'll take a look.

floatingDivs 21 Junior Poster

Violet82,

My apologies. I can't believe I forgot to include the suggestion for which I included a warning. *facepalm*

The suggestion would be to restart the page from scratch and add little by little and test it various browsers. Find the EXACT html code that causes the problem. Just because one thing LOOKS like the problem does not mean it is.

Once again, sorry! Hopefully, Daniweb helps you get your answer.

floatingDivs 21 Junior Poster

Hi Violet82,

I skimmed over the thread and tested out the HTML/CSS in the first post. It works fine in IE8 and Firefox. I realize the problem is IE7, but without sounding like a wise-ass, it should unless you're doing something wrong. At my job, we recently created a calendar solution using floats throughout the page with NO problems, tested in 100's of department skins.

What I'd suggest is NOT fun, but it will pretty much guarantee you'll figure out your trouble-spot. What you think is the issue may not actually be the issue.

Also, is there any way you could upload the site to a public server?

floatingDivs 21 Junior Poster

After viewing the page source, it appears you didn't properly close off your <a> tag. Also, you used <a ref=...> instead of <a href=...>

any notices to True Enterprises shall be given by email to <a ref="mailto:[B][U][I]<script type="text/css">[/I][/U][/B]
floatingDivs 21 Junior Poster

Just took a quick peek at your website. You should consider removing the height:80%; style from your "lightbox" class. If you go to your upcoming events page, you'll see you have text continuing further down the line than the white content area.

floatingDivs 21 Junior Poster

Hi Daniweb,

Have a quick question I'd like answered.

Right now, I'm testing out liquid web sites on a smart phone powered by Android. When I load a (width:100%;) website with the smartphone being taller rather than longer, it comes out looking great. However, when I turn the smartphone 90 degrees, it looks terrible and covers only 30-40% of the screen. Is there anyway for a smartphone to render a width of 100% both ways? That way, when someone wants to read the shorter but wider version, they get the same percentage of width (100%) as someone who prefers to read the taller but skinnier version.

Thanks!

floatingDivs 21 Junior Poster

First off, thank you for the quick responses! Sometimes, topics can go into exile with no response, so getting not one, but three responses is great!

Under no circumstance would I be looking to "reinvent the wheel", but seeing as how the data is stored in XML files and XSL would be used to create the layout, it shouldn't be hard. Currently, the discussion boards are built with divs and spans for everything, which works...but I'm just trying to see if this alternative would work. Working for a university, the applications available to work with don't consist of the large complexities seen with hugely popular sources like phpBB and vBulletin.

Regarding the appearance of a forum using <li>'s, that's not an issue. We use a lot of floats and width->100% to create <div>-like <li>'s. Everything done to make a forum look a certain way with <div>s can be replicated without much hassle using <li>'s by us...I'm just wondering if it would help with screen readers, seeing as how our University as "at the forefront" of accessibility.

floatingDivs 21 Junior Poster

Good job figuring it out on your own! +1 REP

floatingDivs 21 Junior Poster

We're all agreeing to the same thing, what I'm saying is that if a newbie just gets used to this without knowing what they're doing, they might get confused. The right answer for the OP is, 'margin-right: auto; margin-left: auto;'...

Well, this is awkward. For some reason, I thought you were the OP and were responding to teedoff after having asked the question.

My fault.

floatingDivs 21 Junior Poster

:), My point is that it's not 'all' it does...

Hi shaya4207,

The reason it does more than just center the page (it also pushes the wrapper down by putting margin above it and below it) is because margin: 35px auto; means the following:

margin-top:35px;
margin-right:auto;
margin-bottom:35px;
margin-left:auto;

margin:0 auto;

means margin-top and margin-bottom are put to 0px and margin-right + margin-left are put to 0px;

The short-hand notations may seem confusing, so read this page under "Margin - Shorthand Property".

floatingDivs 21 Junior Poster

Hey guys (and gals),

I've been wondering this question for the longest time and no Google query I've tried really seems to answer it. So, I'm going to try to ask this question in the most detailed way possible.

Whenever you go onto a forum / discussion board, the layout is pretty much always the same. Each category (and its boards) are contained inside a table layout (or div in the past few years), but would a list be a possible solution to this?

For instance, for each category "wrapper" (containing the category name and all its boards/sub-boards), instead of using a table/div layout, would using a <h3> (category name) and <ul> (boards) be a valid alternative? I figure screen-readers would have a much easier time navigating through a list than a table layout or a half-dozen <div>'s each inside one another.

floatingDivs 21 Junior Poster

Well, this just became a very embarrassing situation *cough*. Nevertheless, taking down notes. :P

floatingDivs 21 Junior Poster

>>*If I somehow incorrectly explained a part or didn't use proper programming protocol [specifically worried about the array initialization process and if it's frowned upon]... looking at Narue and other helpful programmers, please let me know!*

After telling the OP that you can't use a variable to declare an array-size, you did exactly the same in your code. Adding the word const should fix it. You can't however declare an array of size 0, it's illegal in C++.
Use vectors or new-delete to change the size of the array. Your current method won't compile.

Yeah. Thanks for the heads up. I created the file in gedit without compiling (bro's PC) so I clearly didn't get a chance to test it. See? Learned a new thing today -- array's can't be set to a size of 0 -- and that's not something my book told me. Thanks for the lesson, Nick.

Also, should const be used when passing the array into functions other than get_input() to make sure there is no way to change its values?

floatingDivs 21 Junior Poster

Well, technically, you shouldn't use arrays with a size determined through a variable. It should either be a defined constant(int a[5]) or (int a), but not a variable that may get changed. If you don't know the size of the array at the start of the program, you should probably be using vectors. Nevertheless, for now -- seeing as how you're a beginner -- that should be fine.

Always use "int main()" and not some other variation like "void main()". If you're really interested in knowing why, read this.

You passed your variables into ReadList correctly, but if you want to go by proper C++ naming conventions, you'll always use a lower-case first word or using underscores (so ReadList becomes readList or ReadList becomes read_list). The same should apply to the variables you are passing in. Furthermore, using more descriptive variable names would help someone understand your code better in a short time.

Now, for the brutal truth, just because I feel like helping a newbie out.

Read a good C++ book because you are developing horrendous programming habits.

  • learn how to create functions correctly
  • focus on getting a solid "game plan" set before jumping into the coding
  • understand exactly what each line of code is doing and if it's what you want

The way you've currently set up you program, you have your function declarations placed firmly at the top of your file. That is not how to properly …