ELATED: Authoring and Programming http://www.elated.com/ The nitty-gritty of coding websites. Get help with HTML, CSS, JavaScript, PHP, Perl, or any other Web programming problem. en-us Tue, 11 Jun 2013 19:57:01 GMT Tue, 11 Jun 2013 19:57:01 GMT http://blogs.law.harvard.edu/tech/rss ELATED.com feeder Re: Drag-and-Drop with jQuery: Your Essential Guide http://www.elated.com/forums/topic/5136/#post23476 From: noobie


@matt
I need help to show out some random card numbers after the user has pulled and dropped the first card number to the correct slots.

View » | Reply »

]]>
Tue, 11 Jun 2013 07:19:46 GMT http://www.elated.com/forums/topic/5136#post23476
Re: Drag-and-Drop with jQuery: Your Essential Guide http://www.elated.com/forums/topic/5136/#post23475 From: noobie


Hi,

Your Tutorial is great but i really need help to create a game using this tutorial.

I need help to show out some random cards after the user has pulled and dropped to the correct slots.

Can anybody help me?

[Edited by noobie on 11-Jun-13 01:28]

View » | Reply »

]]>
Tue, 11 Jun 2013 06:25:48 GMT http://www.elated.com/forums/topic/5136#post23475
Re: Build a CMS in an Afternoon with PHP and MySQL http://www.elated.com/forums/topic/5114/#post23474 From: Ryan_Lutz


I would like to know how you would write this for multiple tables

View » | Reply »

]]>
Mon, 10 Jun 2013 14:56:29 GMT http://www.elated.com/forums/topic/5114#post23474
Re: Working with Blogger Variables http://www.elated.com/forums/topic/4831/#post23467 From: matt


I've removed this tutorial now since (a) it was very out of date, and (b) it used a PageKit for the example and we're no longer offering the PageKits. Sorry for any inconvenience.

Cheers,
Matt

--
Matt Doyle, Elated
3rd Edition of my jQuery Mobile book out now! Learn to build mobile web apps. Free sample chapter: http://store.elated.com/


View » | Reply »

]]>
Thu, 06 Jun 2013 02:55:23 GMT http://www.elated.com/forums/topic/4831#post23467
Re: Create Your Own Blogger Template http://www.elated.com/forums/topic/4825/#post23466 From: matt


I've removed this tutorial now since (a) it was very out of date, and (b) it used a PageKit for the example and we're no longer offering the PageKits. Sorry for any inconvenience.

Cheers,
Matt

--
Matt Doyle, Elated
3rd Edition of my jQuery Mobile book out now! Learn to build mobile web apps. Free sample chapter: http://store.elated.com/


View » | Reply »

]]>
Thu, 06 Jun 2013 02:54:41 GMT http://www.elated.com/forums/topic/4825#post23466
Re: Drag-and-Drop with jQuery: Your Essential Guide http://www.elated.com/forums/topic/5136/#post23464 From: hitech


Never mind. After reading a bit about JQuery ui, I came to know that we can store multiple values as data with each cell, and it can be the cell location.


Code:
--------------------
$('<div>' + numbers[i]['value'] + '</div>').data('number', { x: numbers[i]['value'], y: numbers[i]['index'] }).attr('id', 'card' + numbers[i]['index']).appendTo('#cardPile').draggable({
containment: '#content',
stack: '#cardPile div',
cursor: 'move',
revert: true
});

--------------------




Code:
--------------------
$('<div>' + userAnswer[i - 1]['value'] + '</div>').data('number', { x: numbersunsorted[i - 1]['value'], y: numbersunsorted[i - 1]['index'] }).appendTo('#cardSlots').droppable({
accept: '#cardPile div',
hoverClass: 'hovered',
drop: handleCardDrop
--------------------


Then we can read it after dropping the card into the slot

Code:
--------------------
var slotNumber = $(this).data('number').x;
var slotindex = $(this).data('number').y;
var cardNumber = ui.draggable.data('number').x;
var cardindex = ui.draggable.data('number').y;
--------------------


Thanks

[Edited by hitech on 03-Jun-13 07:56]

View » | Reply »

]]>
Mon, 03 Jun 2013 12:55:28 GMT http://www.elated.com/forums/topic/5136#post23464
Re: How to Add Image Uploading to Your CMS http://www.elated.com/forums/topic/5492/#post23462 From: artslave


Matt,
Is there any basic solution to help solve the problem I'm having with the above post.

The Category and Image upload don't seem to work together. I kept receiving errors.

Original Post:
I used your CMS tutorial and then added the Category tutorial and everything worked great. When I went to add the images tutorial, I received error on the adding new articles page:

Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /Applications/MAMP/htdocs/cms/classes/Article.php on line 292

Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /Applications/MAMP/htdocs/cms/classes/Article.php on line 292

Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/cms/classes/Article.php:292) in /Applications/MAMP/htdocs/cms/admin.php on line 133

I wasn't sure why this error was popping up. Any solution? They seem to work independently; however, when I use the code from the image uploaded and category, it pops up with errors.

View » | Reply »

]]>
Fri, 31 May 2013 22:05:15 GMT http://www.elated.com/forums/topic/5492#post23462
Re: Adding a WYSIWYG HTML Editor to Your Site http://www.elated.com/forums/topic/4839/#post23461 From: faytzylox


Hi--

I feel dumb asking this since it seems fairly fundamental and no one else has mentioned it so its most likely something I'm doing wrong... but:

------------------------------------------------------
<textarea cols="80" rows="10" id="content" name="content">
&lt;h1&gt;Article Title&lt;/h1&gt;
&lt;p&gt;Here's some sample text&lt;/p&gt;
</textarea>
<script type="text/javascript">
CKEDITOR.replace( 'articleContent' );
</script>
------------------------------------------------------

It's a snippet of code from the CKEditor example that you've shown above. As you can see, the ID or Name of the textbox is "content" and if my understanding is correct, this is the ID or Name that needs to go into the CKEDITOR.replace call. In this case, "articleContent" is written there when it should be "content"? I'm kind of confused about this. Please help. Thank you.

--
-Fayt

View » | Reply »

]]>
Fri, 31 May 2013 21:03:46 GMT http://www.elated.com/forums/topic/4839#post23461
Re: why do i get a A when i want a http://www.elated.com/forums/topic/5594/#post23459 From: chrishirst


Change the character set to Western Europrean.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Thu, 30 May 2013 17:33:45 GMT http://www.elated.com/forums/topic/5594#post23459
Re: Javascript display document last modified in locale date http://www.elated.com/forums/topic/5590/#post23458 From: chrishirst


Yep or use a CMS that records such information.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Thu, 30 May 2013 17:28:09 GMT http://www.elated.com/forums/topic/5590#post23458
Re: Drag-and-Drop with jQuery: Your Essential Guide http://www.elated.com/forums/topic/5136/#post23457 From: hitech


Hi Matt,
I'm not sure if you are still following this post or not, but any how, I wanted to check with you about some tweak that I made to your code.

My goal is to use this drag and drop for sorting type of exercises for our users.

And I will include the code that i have changed here. My question is how to get the order in which the user has placed his choices in cardSlots. That is, I want to save the user's answer.

Is there any way to do this?

Thanks in advance.


Code:
--------------------
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test.aspx.vb" Inherits="Project.Test"
EnableEventValidation="false" ValidateRequest="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor"
TagPrefix="cc1" %>
<!DOCTYPE html" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head runat="server">
<title>Sorting Exercise</title>
<style type="text/css">
/* Add some margin to the page and set a default font and colour */

body
{
margin: 30px;
font-family: "Georgia" , serif;
line-height: 1.8em;
color: #333;
}

/* Give headings their own font */

h1, h2, h3, h4
{
font-family: "Lucida Sans Unicode" , "Lucida Grande" , sans-serif;
}

/* Main content area */

#content
{
margin: 80px 70px;
text-align: center;
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
}

/* Header/footer boxes */

.wideBox
{
clear: both;
text-align: center;
margin: 70px;
padding: 10px;
background: #ebedf2;
border: 1px solid #333;
}

.wideBox h1
{
font-weight: bold;
margin: 20px;
color: #666;
font-size: 1.5em;
}

/* Slots for final card positions */

#cardSlots
{
margin: 50px auto 0 auto;
background: #ddf;
}

/* The initial pile of unsorted cards */

#cardPile
{
margin: 0 auto;
background: #ffd;
}

#cardSlots, #cardPile
{
width: 200px;
height: 400px;
padding: 0px;
border: 2px solid #333;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
-moz-box-shadow: 0 0 .3em rgba(0, 0, 0, .8);
-webkit-box-shadow: 0 0 .3em rgba(0, 0, 0, .8);
box-shadow: 0 0 .3em rgba(0, 0, 0, .8);
}

/* Individual cards and slots */

#cardSlots div, #cardPile div
{
float: left;
width: 80%;
height: 20px;
padding: 5px;
padding-top: 5px;
padding-bottom: 5px;
border: 2px solid #333;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
margin: 0 0 0 10px;
background: #fff;
}

#cardSlots div:first-child, #cardPile div:first-child
{
/*margin-left: 0;*/
}

#cardSlots div.hovered
{
background: #aaa;
}

#cardSlots div
{
border-style: dashed;
}

#cardPile div
{
background: #666;
color: #fff;
font-size: 12px;
text-shadow: 0 0 3px #000;
}

#cardPile div.ui-draggable-dragging
{
-moz-box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
-webkit-box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
}

/* Individually coloured cards */
#card0.correct
{
background: silver;
}
#card1.correct
{
background: red;
}
#card2.correct
{
background: brown;
}
#card3.correct
{
background: orange;
}
#card4.correct
{
background: yellow;
}
#card5.correct
{
background: green;
}
#card6.correct
{
background: cyan;
}
#card7.correct
{
background: blue;
}
#card8.correct
{
background: indigo;
}
#card9.correct
{
background: purple;
}
#card10.correct
{
background: violet;
}
#card11.correct
{
background: lime;
}
#card12.correct
{
background: Teal;
}
#card13.correct
{
background: Olive;
}
#card14.correct
{
background: White;
}
#card15.correct
{
background: Navy;
}
#card16.correct
{
background: gray;
}

/* "You did it!" message */
#successMessage
{
position: absolute;
left: 580px;
top: 250px;
width: 0;
height: 0;
z-index: 100;
background: #dfd;
border: 2px solid #333;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
-moz-box-shadow: .3em .3em .5em rgba(0, 0, 0, .8);
-webkit-box-shadow: .3em .3em .5em rgba(0, 0, 0, .8);
box-shadow: .3em .3em .5em rgba(0, 0, 0, .8);
padding: 20px;
}
</style>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>
<script type="text/javascript">
var correctCards = 0;
$(init);
//When|we|got|to|the|concert,|the |orchestra| had|already| begun|to|play.
var numbers = [[0, 'When'], [1, 'we'], [2, 'got'], [3, 'to'], [4, 'the'], [5, 'concert'], [6, 'the'], [7, 'orchestra'], [8, 'had'], [9, 'already'], [10, 'begun'], [11, 'to'], [12, 'play']];
var numbersunsorted = [[0, 'When'], [1, 'we'], [2, 'got'], [3, 'to'], [4, 'the'], [5, 'concert'], [6, 'the'], [7, 'orchestra'], [8, 'had'], [9, 'already'], [10, 'begun'], [11, 'to'], [12, 'play']];
function init() {

// Hide the success message
$('#successMessage').hide();
$('#successMessage').css({
left: '580px',
top: '250px',
width: 0,
height: 0
});

// Reset the game
correctCards = 0;
$('#cardPile').html('');
$('#cardSlots').html('');
$('#cardPile').height(35 * numbers.length);
$('#cardSlots').height(35 * numbers.length);


// Create the pile of shuffled cards
numbers.sort(function () { return Math.random() - .5 });
for (var i = 0; i < numbers.length; i++) {
$('<div>' + numbers[i][1] + '</div>').data('number', numbers[i][1]).attr('id', 'card' + numbers[i][0]).appendTo('#cardPile').draggable({
containment: '#content',
stack: '#cardPile div',
cursor: 'move',
revert: true
});
}

// Create the card slots
var words = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''];
for (var i = 1; i <= numbers.length; i++) {
$('<div>' + numbersunsorted[i - 1][1] + '</div>').data('number', numbersunsorted[i - 1][1]).appendTo('#cardSlots').droppable({
accept: '#cardPile div',
hoverClass: 'hovered',
drop: handleCardDrop
});
}

}

function handleCardDrop(event, ui) {
var slotNumber = $(this).data('number');
var cardNumber = ui.draggable.data('number');

// If the card was dropped to the correct slot,
// change the card colour, position it directly
// on top of the slot, and prevent it being dragged
// again
if (slotNumber == cardNumber) {
ui.draggable.addClass('correct');
ui.draggable.draggable('disable');
$(this).droppable('disable');
ui.draggable.position({ of: $(this), my: 'left top', at: 'left top' });
ui.draggable.draggable('option', 'revert', false);
correctCards++;
}


if (slotNumber != cardNumber) {
ui.draggable.addClass('incorrect');
//ui.draggable.draggable('enable');
$(this).droppable('disable');
ui.draggable.position({ of: $(this), my: 'left top', at: 'left top' });
ui.draggable.draggable('option', 'revert', false);

}
// If all the cards have been placed correctly then display a message
// and reset the cards for another go

if (correctCards == numbers.length) {
$('<div>' + 'Your Score is: ' + correctCards + ' out of ' + numbers.length + '</div>').appendTo('#successMessage')
$('#successMessage').show();
$('#successMessage').animate({
left: '380px',
top: '200px',
width: '400px',
height: '100px',
opacity: 1
});
}
}

function showResult() {

$('<div>' + 'Your Score is: ' + correctCards + ' out of ' + numbers.length + '</div>').appendTo('#Div1');
$('#Div1').show();
$('#Div1').animate({
left: '380px',
top: '200px',
width: '400px',
height: '100px',
opacity: 1
});
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="content" style="width: 40%">
<div id="cardPile" style="float: left;">
<div id="card4" class="ui-draggable" style="position: relative;">
4</div>
<div id="card1" class="ui-draggable" style="position: relative;">
1</div>
<div id="card2" class="ui-draggable" style="position: relative;">
2</div>
<div id="card5" class="ui-draggable" style="position: relative;">
5</div>
<div id="card3" class="ui-draggable" style="position: relative;">
3</div>
<div id="card6" class="ui-draggable" style="position: relative;">
6</div>
<div id="card7" class="ui-draggable" style="position: relative;">
7</div>
<div id="card8" class="ui-draggable" style="position: relative;">
8</div>
<div id="card9" class="ui-draggable" style="position: relative;">
9</div>
<div id="card10" class="ui-draggable" style="position: relative;">
10</div>
<div id="card11" class="ui-draggable" style="position: relative;">
11</div>
<div id="card12" class="ui-draggable" style="position: relative;">
12</div>
<div id="card13" class="ui-draggable" style="position: relative;">
13</div>
<div id="card14" class="ui-draggable" style="position: relative;">
14</div>
</div>
<div id="cardSlots">
<div class="ui-droppable">
one</div>
<div class="ui-droppable">
two</div>
<div class="ui-droppable">
three</div>
<div class="ui-droppable">
four</div>
<div class="ui-droppable">
five</div>
<div class="ui-droppable">
six</div>
<div class="ui-droppable">
seven</div>
<div class="ui-droppable">
eight</div>
<div class="ui-droppable">
nine</div>
<div class="ui-droppable">
ten</div>
<div class="ui-droppable">
Eleven</div>
<div class="ui-droppable">
Twelve</div>
<div class="ui-droppable">
Thirteen</div>
<div class="ui-droppable">
Fourteen</div>
</div>
<div id="successMessage" style="display: none; left: 580px; top: 250px; width: 0px;
height: 0px;">
<button onclick="init()">
Play Again</button>
</div>
<button onmouseover="showResult()" onmouseout="$('#Div1').hide(); $('#Div1').html('');">
Show Result</button>
<div id="Div1" style="display: none; left: 580px; top: 250px; width: 0px;
height: 0px;">
</div>

</div>
</form>
</body>
</html>

--------------------


[Edited by hitech on 30-May-13 10:53]

View » | Reply »

]]>
Thu, 30 May 2013 15:52:10 GMT http://www.elated.com/forums/topic/5136#post23457
Re: Javascript display document last modified in locale date http://www.elated.com/forums/topic/5590/#post23456 From: cato


Hi, just a really stupid question, so I hope you can forgive me .....

If I wanted to show the date that the web author of the webpage last did a "static" change to the site, what is the best way to do this?

Should I just "manually" type in the date I want, rather than getting a script to do it?

View » | Reply »

]]>
Thu, 30 May 2013 11:11:28 GMT http://www.elated.com/forums/topic/5590#post23456
Re: How to Make a Slick Ajax Contact Form with jQuery and PHP http://www.elated.com/forums/topic/5171/#post23452 From: mbarcala


Sorry subject field here


Code:
--------------------
$conSenderSubject = isset( $_POST['conSenderSubject'] ) ? preg_replace( "/[^\.\-\_\@a-zA-Z0-9]/", "", $_POST['conSenderSubject'] ) : "";
--------------------


View » | Reply »

]]>
Tue, 28 May 2013 15:24:33 GMT http://www.elated.com/forums/topic/5171#post23452
Re: How to Make a Slick Ajax Contact Form with jQuery and PHP http://www.elated.com/forums/topic/5171/#post23451 From: mbarcala


Hi Matt,

I have 2 issues for you with your form now

1- my subject field, display all word together when i receive the email?

and 2

Code:
--------------------
yours
$headers = "From: " . $senderName . " <" . $senderEmail . ">";

my
$headers = "From: " . RECIPIENT_NAME . " <" . RECIPIENT_EMAIL . ">" . "\r\n" . "Reply-to: " . $conSenderEmail;
--------------------


with your header i can't send any email with this form, alway give me an error message "There was a problem sending your message. Please try again."
with my i can send the email BUT i can't replay to the senderEmail, it just replay to my self.

what could be my problem? i'm using yahoo server PHP 5.3.6

hope you can help to figure out this situation

Best regards

mbarcala

View » | Reply »

]]>
Tue, 28 May 2013 15:23:23 GMT http://www.elated.com/forums/topic/5171#post23451
Re: Banish JavaScript in Web Forms with HTML5 http://www.elated.com/forums/topic/5015/#post23450 From: mmahtabsaleem


Very nice form and easy to use,
I am going to add into my blog. . . Thanks!

View » | Reply »

]]>
Tue, 28 May 2013 14:07:16 GMT http://www.elated.com/forums/topic/5015#post23450
why do i get a A when i want a http://www.elated.com/forums/topic/5594/#post23449 From: cockerhamgoats


hi, im using coffee cup - not impressed with it but hey thats what im using.

when i want to put in a £ sign i always get a A£ show up inthe web view and online.

why is this happening and how can i get a normal £ sign

thanks

--
sharon peacock

View » | Reply »

]]>
Tue, 28 May 2013 09:52:45 GMT http://www.elated.com/forums/topic/5594#post23449
Re: Where is the WampPHP console log. http://www.elated.com/forums/topic/5589/#post23447 From: chrishirst


Explain " it displays correct without all the tags"

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Mon, 27 May 2013 21:52:46 GMT http://www.elated.com/forums/topic/5589#post23447
Re: Javascript display document last modified in locale date http://www.elated.com/forums/topic/5590/#post23446 From: chrishirst


Scripted documents ARE "last modified" on, and at, the instant they are requested and therefore created.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Mon, 27 May 2013 21:50:39 GMT http://www.elated.com/forums/topic/5590#post23446
Re: jQuery Mobile Hosted on Server 1 and Retrieve Data from Server 2 http://www.elated.com/forums/topic/5593/#post23445 From: chrishirst


javascript HAS to be running in the context of the same domain it is hosted on.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Mon, 27 May 2013 21:48:13 GMT http://www.elated.com/forums/topic/5593#post23445
jQuery Mobile Hosted on Server 1 and Retrieve Data from Server 2 http://www.elated.com/forums/topic/5593/#post23444 From: databuzz


I have a simple jQuery Mobile application that is hosted on one server (server1.com) which includes some php pages that query a database hosted on another server (server2.com).

This all works fine when everything (jQuery Mobile website and Database) is hosted on the same server but when they are separated it doesn't display any of the data. I've been looking at the Configuring Defaults documentation at:

http://api.jquerymobile.com/global-config/

and specifically the allowCrossDomainPages option. I've created a new script file called custom-scripting.js which contains the following:



Code:
--------------------
$(document).bind("mobileinit", function(){
$.extend( $.mobile , {
allowCrossDomainPages: true
});
});
--------------------



and the called it as recommended:



Code:
--------------------
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="custom-scripting.js"></script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
--------------------



but my PHP page is still not making the request to server2.com. I was hoping that setting allowCrossDomainPages: true would allow the PHP page to make the request to the external server.

Anyone else setup a similar configuration with jQuery Mobile that needs to retrieve data from an external server using php?

View » | Reply »

]]>
Mon, 27 May 2013 11:05:23 GMT http://www.elated.com/forums/topic/5593#post23444
Javascript display document last modified in locale date http://www.elated.com/forums/topic/5590/#post23441 From: cato


I am a brand new beginner, just learning the basics of Javascript.
For days on end, I have been trying to find code that will display the date the webpage was last updated by the web author.

I have used the below function, however, I find the result defaults to UTC/GMT date when using document.lastModified (despite it being formatted to the local date). So the "look" of the date displays OK, but the date is always behind, showing UTC/GMT date, not AEST (Australian Eastern Standard Time).

I tried a few different date options, and below is how the code displays. 'a' and 'b' reference the document.last modified, but the results are not what I want. (When I updated the webpage where I placed my function, my computer clock showed it was Saturday 25 May 2013, 1:45am. (Again, I don't want the current date displayed on the browser, I want so show the date the webpage was last updated by the web author).

Also, I noticed that 'a' is updating the time each instance the browser is refreshed (which is not what I want, I want the date/time returned of the webpage last update by the web author).

This is not the result I want:
Date last updated using 'a': Fri May 24 2013 15:51:06 GMT+1000 (EST)
Date: 24 / Month: 5 / Year: 2013 / Hours: 15 / Minutes: 51 / Seconds: 6

This is not the result I want:
Date last updated using 'b': 24 May 2013

This is for reference/comparison only, showing current date:
Current date using 'c': Sat May 25 2013 01:51:06 GMT+1000 (EST)
Date: 25 / Month: 5 / Year: 2013 / Hours: 1 / Minutes: 51 / Seconds: 6

Code I used:


Code:
--------------------
function dateUpdated() {

a = new Date(document.lastModified)

b = a.toLocaleDateString()

c = new Date

document.write ( "Date last updated using 'a': " + a + "<br>" +
" Date: " + a.getDate() + " / Month: " + (a.getMonth()+1) + " / Year: " + a.getFullYear() + " / Hours: " + a.getHours() + " / Minutes: " + a.getMinutes() + " / Seconds: " + a.getSeconds() + "<p>")

document.write ( "Date last updated using 'b': " + b + "<p>" )

document.write ( "Current date using 'c': " + c+ "<br>" +
" Date: " + c.getDate() + " / Month: " + (c.getMonth()+1) + " / Year: " + c.getFullYear() + " / Hours: " + c.getHours() + " / Minutes: " + a.getMinutes() + " / Seconds: " + c.getSeconds() + "<br>")

}
--------------------


View » | Reply »

]]>
Fri, 24 May 2013 16:19:09 GMT http://www.elated.com/forums/topic/5590#post23441
Where is the WampPHP console log. http://www.elated.com/forums/topic/5589/#post23440 From: silverhorse1


Hi, I downloaded wamp, but then it says on the web I must open the console log and configure it.
but, all I have is the icon, then when I open it, I get a whole lot of files and folders.
How do I configure it to work, so when I put a php code in the editor, and display it in the browser, it displays correct without all the tags.
could anybody help me. thanks

View » | Reply »

]]>
Fri, 24 May 2013 03:38:18 GMT http://www.elated.com/forums/topic/5589#post23440
Re: A Snazzy Animated Pie Chart with HTML5 and jQuery http://www.elated.com/forums/topic/5000/#post23435 From: zazoo24


HELLO thanks for this lovely article, my question is i want to display the info (in this case widget ...) into one place for example in a little zone just under the pie .

any help please would much appreciated

View » | Reply »

]]>
Tue, 21 May 2013 16:01:22 GMT http://www.elated.com/forums/topic/5000#post23435
Re: How to Add Image Uploading to Your CMS http://www.elated.com/forums/topic/5492/#post23434 From: artslave


I used your CMS tutorial and then added the Category tutorial and everything worked great. When I went to add the images tutorial, I received error on the adding new articles page:

Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /Applications/MAMP/htdocs/cms/classes/Article.php on line 292

Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /Applications/MAMP/htdocs/cms/classes/Article.php on line 292

Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/cms/classes/Article.php:292) in /Applications/MAMP/htdocs/cms/admin.php on line 133

I wasn't sure why this error was popping up. Any solution? They seem to work independently; however, when I use the code from the image uploaded and category, it pops up with errors.

View » | Reply »

]]>
Tue, 21 May 2013 00:17:11 GMT http://www.elated.com/forums/topic/5492#post23434
Re: How to Start a Blog http://www.elated.com/forums/topic/4718/#post23433 From: Aelynn103


Here's a good resource.

Spam REMOVED

[Edited by chrishirst on 20-May-13 07:36]

View » | Reply »

]]>
Sun, 19 May 2013 16:42:48 GMT http://www.elated.com/forums/topic/4718#post23433
Re: Object-Oriented PHP: Delving Deeper into Properties and Methods http://www.elated.com/forums/topic/5195/#post23432 From: anupy


Actually, I was avoiding to read what are magic methods are but now I've got a full understanding of magic method because of your article.

Thanks.

View » | Reply »

]]>
Sun, 19 May 2013 13:14:11 GMT http://www.elated.com/forums/topic/5195#post23432
Re: PHP Variable Scope: All You Need to Know http://www.elated.com/forums/topic/5037/#post23431 From: anupy


Basically, I understood the use of static member. The way you explained that's just great!! Thanks.

View » | Reply »

]]>
Sun, 19 May 2013 13:11:47 GMT http://www.elated.com/forums/topic/5037#post23431
Re: Table adjustment in the form using jQuery Mobile http://www.elated.com/forums/topic/5586/#post23430 From: chrishirst


No.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Sat, 18 May 2013 20:59:00 GMT http://www.elated.com/forums/topic/5586#post23430
Re: Writing Your First PHP Script http://www.elated.com/forums/topic/4720/#post23429 From: chrishirst


You're a few days late for the thread's fourth birthday link drop.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Sat, 18 May 2013 20:57:54 GMT http://www.elated.com/forums/topic/4720#post23429
Re: Writing Your First PHP Script http://www.elated.com/forums/topic/4720/#post23421 From: gopiwisen


Very understandable article

--
Co Author of Wisen Technologies Mastering PHP course material

http://wisentechnologies.com/it-courses/php-training.aspx


View » | Reply »

]]>
Thu, 16 May 2013 13:17:29 GMT http://www.elated.com/forums/topic/4720#post23421
Table adjustment in the form using jQuery Mobile http://www.elated.com/forums/topic/5586/#post23420 From: Ravi


Hi All,

We have a requirement where the table contains multiple rows and columns. When we inserted the table in the form, this is going beyond the view and not fitting the form screen. Is there any possibility to change the view of the table from portrait to landscape mode instead of changing the view of whole form. Please suggest any possible solution for this issue.

Regards,
Ravi G

View » | Reply »

]]>
Thu, 16 May 2013 07:53:14 GMT http://www.elated.com/forums/topic/5586#post23420
Re: How to Start a Blog http://www.elated.com/forums/topic/4718/#post23415 From: chrishirst


"My question is, does Page Rank affects traffic or visitors to my blogsite?"


NO!!

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Sat, 11 May 2013 21:54:09 GMT http://www.elated.com/forums/topic/4718#post23415
Re: How to Start a Blog http://www.elated.com/forums/topic/4718/#post23414 From: davethomas


I am just wondering about how to drive more traffic to my blog in relation to the PR of my blogsite which is http://www.goodblogs.com.au/. My question is, does Page Rank affects traffic or visitors to my blogsite?

[Edited by davethomas on 11-May-13 05:46]

--
Good Blogs - The Number 1 Resource for Bloggers http://www.goodblogs.com.au/

View » | Reply »

]]>
Sat, 11 May 2013 10:43:03 GMT http://www.elated.com/forums/topic/4718#post23414
Re: MySQL for Absolute Beginners http://www.elated.com/forums/topic/5272/#post23411 From: SarahB


Hi Matt, really appreciate this article - it is the simplest and most straightforward definition and explanation of MySQL that I have been able to find on the web. Keep up the good work!

View » | Reply »

]]>
Mon, 06 May 2013 19:23:23 GMT http://www.elated.com/forums/topic/5272#post23411
Re: Add border to webpage on wordpress http://www.elated.com/forums/topic/5584/#post23410 From: chrishirst


First look suggests this;

Use a centered, 90% width, 'wrapper' with a background colour of #F6B829, set margin: 1em 1ex; on the body element and a centered 50% width element for the content area.

also set height / min-height of 100% on the html, body, wrapper and content elements,

That should work I think.

The 90% and 50% are guesstimates based on the jpeg, you may have to adjust them in a real template.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Sun, 05 May 2013 19:03:52 GMT http://www.elated.com/forums/topic/5584#post23410
Add border to webpage on wordpress http://www.elated.com/forums/topic/5584/#post23409 From: my1812


Hey Guys,

I'm having trouble turning my current webpage to www.mytheentrepreneur.com

so it can look like this https://www.dropbox.com/s/4afp8yn8mjaubzh/screenshot.jpg


Please help!

--
My Nguyen

View » | Reply »

]]>
Sat, 04 May 2013 15:26:25 GMT http://www.elated.com/forums/topic/5584#post23409
Re: How to Add Article Categories to Your CMS http://www.elated.com/forums/topic/5391/#post23407 From: snookian


@matt, Please help! Im super stumped. I want the description for each category to appear once you have selected the category.
So i want a input box under each category drop down list like so:



Code:
--------------------
<li>
<label for="categoryId">Article Category</label>
<select name="categoryId">
<option value="0"<?php echo !$results['article']->categoryId ? " selected" : ""?>>(none)</option>
<?php foreach ( $results['categories'] as $category ) { ?>
<option value="<?php echo $category->id?>"<?php echo ( $category->id == $results['article']->categoryId ) ? " selected" : ""?>><?php echo htmlspecialchars( $category->name )?></option>
<?php } ?>
</select>
</li>

<li>
<label for="description">Description</label>
<input type="text" name="description" id="description" value="<?php echo $results['category']->description ?>" />
</li>
--------------------



And then when you select reviews for example the description i put for reviews will appear in the description field. Any help getting me towards my goal will be great.

(I want/need this in the new article page/form)

Ian

[Edited by snookian on 30-Apr-13 09:49]

View » | Reply »

]]>
Tue, 30 Apr 2013 13:15:38 GMT http://www.elated.com/forums/topic/5391#post23407
Re: A Snazzy Animated Pie Chart with HTML5 and jQuery http://www.elated.com/forums/topic/5000/#post23406 From: shanai


The pie chart works awesomely, however it clash with Shareaholic scripts.
When Shareaholic script is installed, the piechart will have problem drawing the pullout slice, it will just show blank for that slice.
Using Chrome Developer tools, the error was
[i]"Uncaught TypeError: Object function (){return i} has no method 'join' "
[/i]

After diving into the script, I made a one line change in function drawChart().

I change from

Code:
--------------------
for ( var slice in chartData ) {
--------------------

to

Code:
--------------------
for ( var slice=0; slice < chartData.length; slice++ ) {
--------------------


Hopefully this will help other who face the same problem.

[Edited by shanai on 30-Apr-13 08:52]

View » | Reply »

]]>
Tue, 30 Apr 2013 08:46:21 GMT http://www.elated.com/forums/topic/5000#post23406
Re: HTML5 on desktop and mobile browsers http://www.elated.com/forums/topic/5583/#post23405 From: whytea


Hi Matt,

I should probably explain where the problem was. While it's working on all browsers, the placement of the text is really incorrect on all mobile browsers. You probably have to run the clock on a desktop browser to know what I meant by "correct".

/Why Tea

View » | Reply »

]]>
Tue, 30 Apr 2013 08:02:56 GMT http://www.elated.com/forums/topic/5583#post23405
Re: How to Add Image Uploading to Your CMS http://www.elated.com/forums/topic/5492/#post23404 From: matt


@tylercook:

1) Make sure your PHP timezone is the same as the MySQL timezone on the server.

2) The "Cannot modify header information" error is merely a side-effect of the first error being reported.

You'll want to add some debugging to see what glob(SERMON_IMAGE_PATH . "/" . IMG_TYPE_FULLSIZE . "/" . $this->id . ".*") is actually returning. It should be an array. If it's not then you'll get that "Invalid argument supplied" error. My guess is it's returning FALSE which means there's a problem accessing the filesystem (eg permissions problem or file not found).

--
Matt Doyle, Elated
3rd Edition of my jQuery Mobile book out now! Learn to build mobile web apps. Free sample chapter: http://store.elated.com/


View » | Reply »

]]>
Tue, 30 Apr 2013 05:54:42 GMT http://www.elated.com/forums/topic/5492#post23404
Re: HTML5 on desktop and mobile browsers http://www.elated.com/forums/topic/5583/#post23403 From: matt


@whytea: Works fine on Safari/iOS6.1 for me (both on device and simulator).

--
Matt Doyle, Elated
3rd Edition of my jQuery Mobile book out now! Learn to build mobile web apps. Free sample chapter: http://store.elated.com/


View » | Reply »

]]>
Tue, 30 Apr 2013 05:48:26 GMT http://www.elated.com/forums/topic/5583#post23403
Re: Multi click reveal script http://www.elated.com/forums/topic/5581/#post23402 From: matt


@JMorris: Set your function up to be a click handler for each of the 3 images. Within the function, the keyword 'this' should hold the HTML element (img) that was clicked on, which you can query to work out its id or src.

Then set the appropriate tile property to true, or whatever value you want to use to signify a click, then test if all 3 properties are true.

You might also find it easier / less fiddly to use jQuery for this sort of thing...

--
Matt Doyle, Elated
3rd Edition of my jQuery Mobile book out now! Learn to build mobile web apps. Free sample chapter: http://store.elated.com/


View » | Reply »

]]>
Tue, 30 Apr 2013 05:23:01 GMT http://www.elated.com/forums/topic/5581#post23402
Re: Create Your Own Blogger Template http://www.elated.com/forums/topic/4825/#post23401 From: matt


@natp: I'm sorry, but we've taken down the free PageKits for various reasons. I need to remove these Blogger tutorials from the site anyway as they're way out of date - not even sure they work anymore. It's on my to-do list...

--
Matt Doyle, Elated
3rd Edition of my jQuery Mobile book out now! Learn to build mobile web apps. Free sample chapter: http://store.elated.com/


View » | Reply »

]]>
Tue, 30 Apr 2013 05:17:29 GMT http://www.elated.com/forums/topic/4825#post23401
Re: A Snazzy Animated Pie Chart with HTML5 and jQuery http://www.elated.com/forums/topic/5000/#post23399 From: matt


@vinsite54: I'd need to see more context to answer your question. How are you pulling the data from the DB? If you're using Ajax then it should be fairly easy to use JS to change the tr elements as well as the chartColours array.

@jffgrdnr: Glad it helped! You should be able to just replace the rgb() notation in drawSlice() with rgba(), where 'a' is the alpha (opacity) value you want to use. 'a' ranges from 0 (completely transparent) to 1 (completely opaque).

--
Matt Doyle, Elated
3rd Edition of my jQuery Mobile book out now! Learn to build mobile web apps. Free sample chapter: http://store.elated.com/


View » | Reply »

]]>
Tue, 30 Apr 2013 05:01:30 GMT http://www.elated.com/forums/topic/5000#post23399
Re: How to Make a Slick Ajax Contact Form with jQuery and PHP http://www.elated.com/forums/topic/5171/#post23398 From: matt


@mbarcala: The PHP code looks OK (although of course you should uncomment the EMAIL_SUBJECT define at the top). What isn't working exactly?

@one: See:

http://www.elated.com/forums/topic/5171/#post21905
http://www.elated.com/forums/topic/5171/#post21909

--
Matt Doyle, Elated
3rd Edition of my jQuery Mobile book out now! Learn to build mobile web apps. Free sample chapter: http://store.elated.com/


View » | Reply »

]]>
Tue, 30 Apr 2013 04:40:49 GMT http://www.elated.com/forums/topic/5171#post23398
Re: JavaScript Tabs - Create Tabbed Web Pages Easily http://www.elated.com/forums/topic/4717/#post23397 From: matt


@JP: Looks like that page uses jQuery UI's tabs, if that helps? http://jqueryui.com/tabs/

@chynawhyte: You could try wrapping the tabs in a parent div using overflow: scroll, or perhaps in an iframe?

--
Matt Doyle, Elated
3rd Edition of my jQuery Mobile book out now! Learn to build mobile web apps. Free sample chapter: http://store.elated.com/


View » | Reply »

]]>
Tue, 30 Apr 2013 04:27:58 GMT http://www.elated.com/forums/topic/4717#post23397
Re: HTML5 Template Giveaway: Win a Copy of Type & Grids Pro http://www.elated.com/forums/topic/5579/#post23396 From: mguerra79


Hi guys! Thank you all and congrat all the other winners. I don't remember when did I won anything the last time, other than my lovely baby daughter!
So, I want to say that I'm very happy, and will have to take a nice look at the book!

Thank you guys!

Cheers from Portugal!

Márcio Guerra

--
There are only 2 infinite things, the universe and mens stupidity, and Im not sure about the first one!

Or something like it...
By Albert Einstein


View » | Reply »

]]>
Fri, 26 Apr 2013 21:09:52 GMT http://www.elated.com/forums/topic/5579#post23396
Re: How to Add Image Uploading to Your CMS http://www.elated.com/forums/topic/5492/#post23392 From: tylercook


Matt, great job on the tutorials. I must say I have learned an enormous amount of php over the last few months due to using your CMS as a foundation.

However, I am having a bit of an issue when I move everything from my localhost to my mediatemple server. I have fixed a ton of the errors that I had but these two persist.

1) The dates bump one day back every time I add a new post. Also, when I update the post it bumps one day further back. I have changed the timezone to America/Chicago from the php website and have looked at a few of the UNIX time fixes and havent really found anything that worked yet.

2) I am getting an invalid argument error and header error when I try to delete a post. Here is the error that I get from the browser (this is for a church so Article was replaced by Sermon):

[i][b]Warning: Invalid argument supplied for foreach() in tylercookmedia.com/html/clients/agape/admin/classes/Sermon.php on line 162

Warning: Invalid argument supplied for foreach() in tylercookmedia.com/html/clients/agape/admin/classes/Sermon.php on line 167

Warning: Cannot modify header information - headers already sent by (output started at tylercookmedia.com/html/clients/agape/admin/classes/Sermon.php:162) in tylercookmedia.com/html/clients/agape/admin/add-sermon.php on line 145[/b]
[/i]

Here is the code from all of those lines and I am pretty much stuck as to what the problem is sense it works locally but not on the live server.

line 162

Code:
--------------------
// Delete all fullsize images for this Sermon
foreach (glob(SERMON_IMAGE_PATH . "/" . IMG_TYPE_FULLSIZE . "/" . $this->id . ".*") as $filename) {
if ( !unlink( $filename ) ) trigger_error( "Sermon::deleteImages(): Couldn't delete image file.", E_USER_ERROR );
}
--------------------


Line 167

Code:
-------------------- 
// Delete all thumbnail images for this Sermon
foreach (glob( SERMON_IMAGE_PATH . "/" . IMG_TYPE_THUMB . "/" . $this->id . ".*") as $filename) {
if ( !unlink( $filename ) ) trigger_error( "Sermon::deleteImages(): Couldn't delete thumbnail file.", E_USER_ERROR );
}
--------------------


Header Error on line 145 (im assuming that once the for each error is resolved this one will work itself out)


Code:
--------------------
function deleteSermon() {

if ( !$sermon = Sermon::getById( (int)$_GET['sermonId'] ) ) {
header( "Location: add-sermon.php?error=sermoneNotFound" );
return;
}

$sermon->deleteImages();
$sermon->delete();
header( "Location: add-sermon.php?status=sermonDeleted" );
}
--------------------


Any ideas on what could be causing this would be much appreciated.

View » | Reply »

]]>
Thu, 25 Apr 2013 16:01:00 GMT http://www.elated.com/forums/topic/5492#post23392
Re: JavaScript Tabs - Create Tabbed Web Pages Easily http://www.elated.com/forums/topic/4717/#post23391 From: chynawhyte


This is a great post and I love this tabs example!

Is there a way to make the tabs scrollable? I have quite a few tabs and I'd like the user to be able to scroll to the right or left to get the tabe they are looking for.

View » | Reply »

]]>
Thu, 25 Apr 2013 12:34:58 GMT http://www.elated.com/forums/topic/4717#post23391
HTML5 on desktop and mobile browsers http://www.elated.com/forums/topic/5583/#post23390 From: whytea


New to HTML5. Tried to program with canvas with some Javascript for a clock. The clock in English looks correct on all desktop browsers tested, but not in ANY mobile browsers (chrome, safari, firefox, opera) on iOS and Android. But the clock in Chinese doesn't have such a problem. Does anyone know why?
(Link to the code: http://whytea.net/EnglishClock/index2.html)

I Googled but couldn't find an answer. So I gave up and forgot about it for a while. Now I'm trying Elated to see if I could be Enlightened


/Why Tea

[Edited by whytea on 26-Apr-13 20:07]

View » | Reply »

]]>
Thu, 25 Apr 2013 08:23:33 GMT http://www.elated.com/forums/topic/5583#post23390