All times are UTC




Post new topic Reply to topic  [ 70 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Sat Nov 12, 2011 11:05 am 
Legend
Legend
User avatar

AKA: á / GDMFSOB
PSN: annyfm
Steam: annyfm
Game Center: annyfm
(For absolute beginners) Learn to javascript: http://www.codecademy.com/

_________________
Johnny Ryall wrote:


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 13, 2012 9:01 am 
Veteran
Veteran
User avatar
I'll just leave this here:

Code:
<?php

/*
   sam_lib.php
   
   (c) 2011-2012, Sam D. Gwilliam
   
   A collection of useful functions:
   
>      generateTableRowFromArray ($array, [$type], [$echo])
      
         - Generates an HTML table row from a 1D array. Returns (and optionally echoes) the HTML.
         - Optional 'type' argument ("h" or "n") for creating heading (<th>) rows or normal (<td>) rows.
         - Optional 'echo' argument: if not NULL, also echoes the HTML (in addition to returning it).
         
>      generateVerticalTableFromArray ($array, [$class], [$echo])
      
         - Generates a vertical, 2-col HTML table from a 1D assoc. array. Returns (and optionally echoes) the HTML.
         - Each row is a name/value pair, rendered as <th> and <td> elements, respectively.
         - Optional 'class' argument (in <table> tag) for CSS styling.
         - Optional 'echo' argument: if not NULL, also echoes the HTML (in addition to returning it).
   
>      generateTableFromResult ($result, [$class], [$echo])
      
         - Generates an HTML table from a MySQL query result. Returns (and optionally echoes) the HTML.
         - Optional 'class' argument (in <table> tag) for CSS styling.
         - Optional 'echo' argument: if not NULL, also echoes the HTML (in addition to returning it).
         
>      countArrayDim ($array)
      
         - Recursively computes the dimensionality of a variable/array.
         - Returns 0 for a normal variable, 1 for a 1D array, 2 for a 2D array, etc...
         - Argument 2, [$count], is omitted here because the user must ignore it (and allow it to default to 0),
            it serves simply as a mechanism to pass the incrementing dimension count along the recursion chain!

   General notes:
   
      - Use of square brackets in this annotation (e.g. [$foo]) indicates an optional/hidden argument.
*/

// --- FUNCTIONS --------------------------------------------------------------------------------------------------------------

/*   
   generateTableRowFromArray ($result, [$type], [$echo])
   
   Takes a 1D array and generates a horizontal HTML table row.
   The row's contents can be headings (<th>), or normal data
   (<td>) - depending on the argument passed through $type.
   A mixture of <td> and <th> tags in a single row is not possible with this function.
   
   Optional 'type' argument:
      "n" = normal data (this is the default if $type is omitted for the call).
      "h" = heading data.
      
   Optional 'echo' argument allows direct echoing of HTML (in addition to it being returned).
   
   NOTE:
      This function only generates a single, complete ROW!
      It is up to you to place the function's output between a <table></table> pair!
*/

// Default "n" & NULL allows args 2 & 3 to be omitted:
function generateTableRowFromArray ($array, $type = "n", $echo = NULL)      
{
   $html = "<tr>";                     // Initialise HTML with table row opening.
   
   // Ensure array has content and is 1D:
   if ((sizeof ($array)) && (countArrayDim ($array) == 1))
   {
      $tag = ($type == "h" ? "th" : "td");   // Generate <th> or <td> tag, according to type.
         
      foreach ($array as $data)
         $html .= "<$tag>$data</$tag>";      // Add each data element, surrounded by the relevant tags.      
   }
      
   // Otherwise generate warning:
   else
      $html .= "<th>Warning: cannot generate table row.<br />Content empty or not a 1D array!</th>";
      
   $html .= "</tr>";                  // End row.
   
   // If desired, directly echo the table (in addition to returning the HTML to caller):
   if ($echo)
      echo ($html);      // Echo table row HTML.
      
   return $html;         // Return it, too, in case caller wishes to further process the HTML.
}

// ----------------------------------------------------------------------------------------------------------------------------

/*
   generateVerticalTableFromArray ($array, [$class], [$labels], [$echo])
   
   Takes a 1D associative array and generates a 2-column vertical HTML table.
   
   In other words, each table row is a name/value pair, as opposed to a horizontal
   table, where the first row contains all the names (as <th> elements) and the
   second row contains the respective values (as <td> elements).
   
   Optional 'class' argument allows for CSS styling.
   Optional 'labels' argument must be a numeric array, providing headings for both columns.
   Optional 'echo' argument allows direct echoing of HTML (in addition to it being returned).
*/
   
// Default NULLs allow args 2 & 3 to be omitted:
function generateVerticalTableFromArray ($array, $class = NULL, $labels = NULL, $echo = NULL)
{   
   $size = sizeof ($array);      // Get array size.
   
   $html = "<table";                           // Initialise HTML with partial <table> tag.
   $html .= ($class ? " class='$class'" : "") . ">";   // Add HTML class name (if present) and close.
   
   // Ensure array has content and is 1D:
   if (($size) && (countArrayDim ($array) == 1))
   {
      $name = array_keys ($array);   // Get names of each entry.

      // If labels not provided:
      if (!$labels)
         $html .= "<tr><th>Col A</th><th>Col B</th></tr>";      // Use default labels.
         
      else
      {
         $colA = $labels [0];      // Retrieve provided labels.
         $colB = $labels [1];

         $html .= "<tr><th>$colA</th><th>$colB</th></tr>";      // Use provided labels.
      }
            
      // Generate table content - each name/value pair row:
      for ($i = 0; $i < $size; $i++)
      {
         $key = $name [$i];                        // Store name of current element (also used to index $array []).
         
         $html .= "<tr><th>" . $key . "</th>";         // Open row and heading.
         $html .= "<td>" . $array [$key] . "</td></tr>";   // Content indexed by name ($key).
      }
   }
   
   // Otherwise generate warning:
   else
      $html .= "<tr><th>Warning: cannot generate vertical table.<br />Content empty or not a 1D array!</th></tr>";
      
   $html .= "</table>";                        // End table.
   
   // If desired, directly echo the table (in addition to returning the HTML to caller):
   if ($echo)
      echo ($html);      // Echo table HTML.
      
   return $html;         // Return it, too, in case caller wishes to further process the HTML.
}

// ----------------------------------------------------------------------------------------------------------------------------

/*   
   generateTableFromResult ($result, [$class], [$echo])
   
   Takes a MySQL 'result' object and generates an HTML table, with column headings
   (as they appear in the MySQL table) and an optional HTML class value (allowing
   for different queries to be formatted independently, according to your CSS).
   
   Optional 'class' argument allows for CSS styling.
   Optional 'echo' argument allows direct echoing of HTML (in addition to it being returned).
*/

// Default NULLs allow args 2 & 3 to be omitted:
function generateTableFromResult ($result, $class = NULL, $echo = NULL)      
{
   $rows = mysql_num_rows ($result);      // Row count of table (number of actual data rows, plus the row of col. names.
   $row = mysql_fetch_assoc ($result);      // Pre-emptively get first row (read-ahead).
   
   $html = "<table";                              // Initialise HTML with partial <table> tag.
   $html .= ($class ? " class='$class'" : "") . ">";      // Add HTML class name (if present) and close.
   
   // Ensure array from mysql_fetch_assoc () has content and is 1D (i.e. actually a row):
   if ((sizeof ($row)) && (countArrayDim ($row) == 1))
   {
      $headings = array_keys ($row);         // Use first row to extract key names for column headings.

      // Display column headings row:
      $html .= generateTableRowFromArray ($headings, "h");   // "h" ensures use of <th> instead of <td>.   

      // Display each results row:
      for ($i = 0; $i < $rows; $i++)
      {
         $html .= generateTableRowFromArray ($row);      // Type omitted, so normal table data (i.e. <td>).
         $row = mysql_fetch_assoc ($result);            // Fetch next row from result for next iteration.
      }
      
      mysql_data_seek ($result, 0);   // Go back to start of query in case of subsequent calls!
   }
   
   // Otherwise generate warning:
   else
      $html .= "<tr><th>Warning: cannot generate query table.<br />Query empty or 'row' not a 1D array!</th></tr>";
      
   $html .= "</table>";         // End table.
   
   // If desired, directly echo the table (in addition to returning the HTML to caller):
   if ($echo)
      echo ($html);      // Echo table HTML.
      
   return $html;         // Return it, too, in case caller wishes to further process the HTML.
}

// ----------------------------------------------------------------------------------------------------------------------------

/*
   countArrayDim ($array, [$count])
   
   Uses a recursive chain of is_array () tests to generate a running total of the
   dimensionality of the object passed in $array. Once an is_array () test fails,
   the dimension total is returned - causing it to be passed back up through the
   recursion chain as it unravels.
   
   Does NOT echo, simply returns total array depth.
   
   Hidden argument 'count' is never included in your initial call. It is used on the
      recursive calls to keep track of the running dimension total (which is eventually
      returned to the caller).
*/
      
// It is ESSENTIAL that $count begins on 0, do not set this variable upon calling:
function countArrayDim ($array, $count = 0)
{
   // Check if it's an array:
   if (is_array ($array))
   {
      $count++;      // If this element is an array, then one more dimension.
      
      // Check to see if this array's elements are sub-arrays (foreach () allows handling of numeric and associative arrays):
      foreach ($array as $a)                  // Gets first element, as loop will only run once due to return statement!
         return countArrayDim ($a, $count);      // Recursively call with this array's first element.
   }
   
   // If this code is reached, then there are no more dimensions to this array.
   // Therefore, the final dimension count is returned and the recursion chain is unravelled:
   
   return $count;      // Send it up the chain!
}

?>


It's just a small library of useful PHP functions I've written - mostly to do with generating tables from arrays and MySQL queries. You can also assign each table a class name, so it's appropriately styled by your CSS.

It's just my attempt at consolidating my learnings so far (I'm on cookies at the moment and I thought a function to display all cookies in a table would be handy).

_________________
www.samgwilliam.com


Top
 Profile  
Reply with quote  
PostPosted: Sat Jun 09, 2012 8:48 pm 
User
User

LIVE: Mystery Entry
Steam: mysteryentry
I am not sure if this is allowed, but It is more of a suggestion.

If you could take a look over my website/forum, It would be great if you could recommend it as a web-development community.

Please let me know what you think.
www.youngwebbuilder.com

Thanks

Oliver


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 10, 2012 10:06 am 
User
User

LIVE: Mystery Entry
Steam: mysteryentry
Rightey wrote:
Does anyone know if it is possible to overlay collapsible panels onto a google maps frame?

Basically I mean something like what they have here...

http://www.flashearth.com/

I'm building the page with Dreamweaver, I know notepadd++ was suggested and I did get it to play around with it but for my course work I specifically have to use Dreamweaver.

So I have the code for the Spry collapsible panel because that is built in I'm just having trouble actually putting it on top of the google map portion of the page. Is that even possible or would it be best to just have it separate?


Really nice website.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 10, 2012 10:07 am 
User
User

LIVE: Mystery Entry
Steam: mysteryentry
SimonM_89 wrote:
I'm designing/developing my first website so far. It's a baby boutique website that I'm doing for my sister.

It's going quite well ATM, but I was wandering whats the best cart/payment method system to use. So far there's a gallery for the products (just using one off of dynamic drive at the minute, but I do plan on building one myself once I get used to CSS a bit more) and if you click on an image, a new window opens showing a bigger product picture & the information, through html.

There's also a button that links to a form for custom orders. So far there's nothing for payment on any of the pages, just some order & customer information (address, name, quantity etc). So I was wandering what to do payment wise: incorporate a Google Checkout or PayPal cart, or develop a database myself. My Database skills where quite good in college, but we didn't do much MySQL. If I did do a database, using some combination of MySQL & PHP & perhaps a bit of XML, I'm not sure what I need to be aware of Legally & Financially, if anything. Haven't done E-Commerce in a bit either.

I'd also like to say that Internet Explorer is a complete banana split. I've only tested in the latest versions of IE, Chrome & FireFox so far, and IE has strawberry floated up half of the images, gallery & links :fp:. I've yet to validate any of the pages (think I'm going to do this before it goes server-side & then once again when the server stuff (PHP, SQL, Capatcha, Cart[?]) etc has been done. Need to check it out in safari & opera as well as it goes.


Depends how much money you have to spend, however shopify is a good one right now.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 10, 2012 10:07 am 
Legend
Legend
User avatar

AKA: á / GDMFSOB
PSN: annyfm
Steam: annyfm
Game Center: annyfm
Sorry but I can't tell you anything positive: YWB just comes across as link bait with zero meaningful content. There are a million sites out there just like that.

What exactly are you trying to achieve?

_________________
Johnny Ryall wrote:


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 10, 2012 10:30 am 
User
User

LIVE: Mystery Entry
Steam: mysteryentry
That is the complete opposite to what the website is, and I shall make a good attempt at explaining it.

Basically YWB is the ONLY website of it's kind
YWB is a website which is and will be similar to http://www.youngentrepreneur.com however with noticeable differences.
Youngwebbuilder features frequent competitions and support from relevant business's hopefully soon Canterbury University.
We have a LOT of quality information and support, especially in the forum, there is a lot of new content coming, including helpful mobile apps, and all sorts.
YWB has and is always looking for skilled people, of which you can find a few already positioned on the website and read a bit about them.

You can also find us on http://www.killerstartups.com.
We are hoping to also run funding competitions where the winners will receive start-up capital to build their own website.

Basically we are aimed at anyone between the ages of 13 and 25, we discuss building websites, making money online, running a business, entrepreneurial skills and more.


Last edited by mogoko on Sun Jun 10, 2012 10:34 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 10, 2012 10:33 am 
Veteran
Veteran
User avatar

LIVE: Errkal
Steam: Errkal
Just had a quick look it looks like one of a million sites I would land on and just close right away.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 10, 2012 10:34 am 
User
User

LIVE: Mystery Entry
Steam: mysteryentry
Errkal wrote:
Just had a quick look it looks like one of a million sites I would land on and just close right away.


Interesting, what about it makes you think that?

So basically, unless you were clicking from google through to one of the articles to specifically read it, you would not join the community by landing on the homepage?
What would make you join the community, or regularly read the content.

By the way, the articles on the homepage may not be a good representation right now, there are some better ones that have been pushed down a little.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 10, 2012 10:37 am 
Veteran
Veteran
User avatar

LIVE: Errkal
Steam: Errkal
mogoko wrote:
Errkal wrote:
Just had a quick look it looks like one of a million sites I would land on and just close right away.


Interesting, what about it makes you think that?


I don't know. Just a feeling of nope I'll find something else.

Not sure what it is, just something. Also it looks like you've just gone into the wordpress theme section and downloaded and applied a stock theme. It looks like a half arsed attempt at making a site.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 10, 2012 11:16 am 
User
User

LIVE: Mystery Entry
Steam: mysteryentry
Errkal wrote:
mogoko wrote:
Errkal wrote:
Just had a quick look it looks like one of a million sites I would land on and just close right away.


Interesting, what about it makes you think that?


I don't know. Just a feeling of nope I'll find something else.

Not sure what it is, just something. Also it looks like you've just gone into the wordpress theme section and downloaded and applied a stock theme. It looks like a half arsed attempt at making a site.


Sounds good, If everyone loved it that would not be a good thing.

So I have a job to do!!


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 10, 2012 11:18 am 
Veteran
Veteran
User avatar

LIVE: Errkal
Steam: Errkal
mogoko wrote:
Errkal wrote:
mogoko wrote:
Errkal wrote:
Just had a quick look it looks like one of a million sites I would land on and just close right away.


Interesting, what about it makes you think that?


I don't know. Just a feeling of nope I'll find something else.

Not sure what it is, just something. Also it looks like you've just gone into the wordpress theme section and downloaded and applied a stock theme. It looks like a half arsed attempt at making a site.


Sounds good, If everyone loved it that would not be a good thing.

So I have a job to do!!


Glad I helped :P


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 10, 2012 12:40 pm 
Legend
Legend
User avatar

AKA: á / GDMFSOB
PSN: annyfm
Steam: annyfm
Game Center: annyfm
mogoko wrote:
That is the complete opposite to what the website is, and I shall make a good attempt at explaining it.

Basically YWB is the ONLY website of it's kind
YWB is a website which is and will be similar to http://www.youngentrepreneur.com however with noticeable differences.
Youngwebbuilder features frequent competitions and support from relevant business's hopefully soon Canterbury University.
We have a LOT of quality information and support, especially in the forum, there is a lot of new content coming, including helpful mobile apps, and all sorts.
YWB has and is always looking for skilled people, of which you can find a few already positioned on the website and read a bit about them.

You can also find us on http://www.killerstartups.com.
We are hoping to also run funding competitions where the winners will receive start-up capital to build their own website.

Basically we are aimed at anyone between the ages of 13 and 25, we discuss building websites, making money online, running a business, entrepreneurial skills and more.


Etc etc but where is it going? How you going to get youngsters making money out of selling websites? The industry aint there any more. Maybe 10 years ago when a script kiddy could sell some gooseberry fool out his own hand. The market today doesn't support that. Best anyone can hope is to land a decent position in an agency and learn something about this business there, not from a generic website offering limited advice in too-vague terms to be really valuable.

Days of "it's out there! Go for it!" are long gone - I should know, I'm a web developer who's been there. I'm assuming you fall in my age range (18-25, though I'm pushing the top end) and if you have anything to do with where this world is going, you know it's a redundant market. Corporations got the top end and everyone else is struggling as gooseberry fool to get noticed because strawberry float, this is the internet. The internet is a billion times bigger than anything that's ever existed in human history. Unless you're selling something genuinely new and interesting, you going to vanish as quickly as you appeared. Nobody gives a gooseberry fool about Mr. SEO, one direction, Mrs SEO another. Like all the incumbent industries in the world we've figured out it's connections that matter, not raw selling ability or design ability or idk whatever it is you're trying to put on the street.

Take this from someone jaded by the fashion/web crossover industry as that's my line... and I've been in this for a good few years now. I'm not trying to be a downer but I look at your site, I see literally nothing worth considering or even tweeting about (and we all know that's the cheapest currency around). Maybe I'm not your target audience at all. Then, take this with a pinch of salt. But any young web dev worth their salt knows that smashing mag is bullshit, that start-ups are no more without TRULY NEW goods... idk, it seems like you're trying to trade on information, but aint none of it new, and anything really new is going to find its feet in grassroots efforts, not in basic & noncommittal blogs with mediocre domain names and logos. If you really want to reach out, you need to find the people who are already behind you - because aint nobody going to find you otherwise.

PS there's nothing that is the "ONLY" of its kind.

_________________
Johnny Ryall wrote:


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 10, 2012 12:45 pm 
Legend
Legend
User avatar

AKA: á / GDMFSOB
PSN: annyfm
Steam: annyfm
Game Center: annyfm
on a more positive note I'm a strawberry floating cock and drunk before it's even 2pm so wherever it was I said to talk my advice with a pinch of salt, I meant a shaker of salt, strawberry float!!!! but your very latest article doesn't give me enough confidence to get hard, never mind try to pitch it to some kiddies that don't even know where to start..

_________________
Johnny Ryall wrote:


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 10, 2012 2:37 pm 
User
User

LIVE: Mystery Entry
Steam: mysteryentry
I would not base the site from that at all.

That is a bad representation, and that is definitely not one of the founding members of the site, just a team member.

You started off by saying that "selling websites" is a dying industry. This is not really just one of the ideas, the website is about making websites, maybe selling websites, but we aim to discuss everything from apps, video production etc.. Soon, much like how moneysavingexpert offers everything to do with saving money, well we are basically the opposite. Just branded around websites and the internet to start with.

I wont link you to any but here are some ideas you may find more interesting:

How to build trust around your website
How to make money with an Amazon associates affiliated website
How to build a monster opt-in list of 10K+ Fast
Why Mathematics is the key to success for young entrepreneurs
How do I use twitter for marketing?
How To Build Your Own Twitter Fanpage that makes money
Tools to engage your site readers!
Free Competitor Analysis Guide
6 Ways Students Can Make Money Online
Making Money Building Websites For Local Business
Build a Website for a few Quid, or a shop for £1000′s?

Any there more interesting for you?

I know what you mean it is not easy to stand out online, but does that not depend on how you take it? There are still people under 20 making new start-up web-business's that no one had ever thought of.

And yes, we are definitely going to try and get people behind us.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 10, 2012 2:56 pm 
Legend
Legend
User avatar

AKA: á / GDMFSOB
PSN: annyfm
Steam: annyfm
Game Center: annyfm
Maybe I'm conservative despite my core values and being real unhelpful man, who's to say. I'm just giving you what I believe with my perspective... if you disagree then go out there and shake your money maker. I'm certainly no representative of your target audience. I just don't believe that anything of what you're offering has any real value to young uns who want to get involved, because in the end we all going to get strawberry floated over by forces beyond our control.

strawberry float it, I'm far gone - I hope you inspire someone with a more optimistic worldview. Good luck to you whatever man

_________________
Johnny Ryall wrote:


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 21, 2012 6:22 pm 
User
User

LIVE: Mystery Entry
Steam: mysteryentry
Thanks for the feedback man!

We are going to be making a lot of improvements soon, and doing a lot of cool stuff ;) I can't give it away yet. But, we are going to be doing more then we are now.

I would very much appreciate any more feedback if anyone has any.

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 07, 2012 12:50 pm 
Regular
Regular
User avatar

AKA: Cornelius Wondergarten
I must say I've really been enjoying code academy, for the most part. It's nice to have a set 'class' for you to do, rather than me finding random tutorials and trying to figure out what to do next. As a beginner it really makes it less daunting.


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 04, 2012 1:17 pm 
Regular
Regular
User avatar

LIVE: CitizenErasedII
PSN: Deception217
Where's the best place to register a domain name guys?

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 04, 2012 1:19 pm 
Legend
Legend
User avatar

AKA: á / GDMFSOB
PSN: annyfm
Steam: annyfm
Game Center: annyfm
I moved from godaddy to gandi.net who are brilliant. feel like i can trust them and their customer support is great.

_________________
Johnny Ryall wrote:


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 70 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC



Who is online

Users browsing this forum: Grumpy David and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group