[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
www.dhtmlgoodies.com • View topic - Save item
Page 1 of 1

Save item

PostPosted: Sun Mar 04, 2007 9:11 pm
by Daun
Sorry but my english is not good hope you understand.

Well i whant to save a items when i click on the link so next time i visit it should be there.
example
from the index.php
<li><a href="#" onclick="createRadio();">Radio</a></li>
<li><a href="#" onclick="createYoutube();">Youtube</a></li>

And from dragable-boxes.js

function createRadio()
{

var htmlContentOfNewBox = '<center><embed src="radio.php" width="150" height="150" wmode="transparent" type="application/x-shockwave-flash"></center>'; // HTML content of new box
var titleOfNewBox = 'Radio';
if(!staticObjectArray['staticObject3']){ // The box is not stored in cookie - we need to create it.
var newIndex = createABox(2,false,false,'staticObject3');
document.getElementById('dragableBoxContent' + newIndex).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + newIndex).innerHTML = titleOfNewBox;
}else{ // Box is stored in cookie - all we have to do is to move content into it.
document.getElementById('dragableBoxContent' + staticObjectArray['staticObject3']).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + staticObjectArray['staticObject3']).innerHTML = titleOfNewBox;

}
}
hideHeaderOptionsForStaticBoxes(staticObjectArray['staticObject3']);

function createYoutube()
{

var htmlContentOfNewBox = '<center><iframe src="youtube.php" name="iframe" width="230" marginwidth="10" height="100" marginheight="10" scrolling="auto"></iframe></center>'; // HTML content of new box
var titleOfNewBox = 'YouTube';
if(!staticObjectArray['staticObject4']){ // The box is not stored in cookie - we need to create it.
var newIndex = createABox(2,false,false,'staticObject4');
document.getElementById('dragableBoxContent' + newIndex).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + newIndex).innerHTML = titleOfNewBox;
}else{ // Box is stored in cookie - all we have to do is to move content into it.
document.getElementById('dragableBoxContent' + staticObjectArray['staticObject4']).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + staticObjectArray['staticObject4']).innerHTML = titleOfNewBox;

}
}
hideHeaderOptionsForStaticBoxes(staticObjectArray['staticObject4']);

PostPosted: Thu Mar 08, 2007 4:45 pm
by Daun

PostPosted: Fri Mar 09, 2007 9:05 am
by rpgmax

PostPosted: Fri Mar 09, 2007 6:46 pm
by Daun
Is it this line you mean setTimeout('saveCookies()',100);
Should i add it after this line
hideHeaderOptionsForStaticBoxes(staticObjectArray['staticObject2']);

PostPosted: Fri Mar 09, 2007 7:19 pm
by Batalf
Daun,

Try to use the dragable-boxes.js which you find in the downloadable zip file.(it has been updated with some fixes today).

PostPosted: Fri Mar 09, 2007 8:49 pm
by Daun
I have download the new one and add this but the create funktion dosent work.. What have i done wrong

/* Create static boxes */
function createClock()
{
var htmlContentOfNewBox = '<center><embed src="http://www.clocklink.com/clocks/0018-silver.swf?TimeZone=NZT&" width="150" height="150" wmode="transparent" type="application/x-shockwave-flash"></center>'; // HTML content of new box
var titleOfNewBox = 'Clock';
if(!staticObjectArray['staticObject1']){ // The box is not stored in cookie - we need to create it.
var newIndex = createABox(1,100,false,'staticObject1');
document.getElementById('dragableBoxContent' + newIndex).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + newIndex).innerHTML = titleOfNewBox;
}else{ // Box is stored in cookie - all we have to do is to move content into it.
document.getElementById('dragableBoxContent' + staticObjectArray['staticObject1']).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + staticObjectArray['staticObject1']).innerHTML = titleOfNewBox;

}
hideHeaderOptionsForStaticBoxes(staticObjectArray['staticObject1']);

function createRadio()
{
var htmlContentOfNewBox = '<center><iframe src="http://qunet.no-ip.org/drag/radio.htm" name="iframe" width="230" marginwidth="10" height="100" marginheight="10" scrolling="auto"></iframe></center>'; // HTML content of new box
var titleOfNewBox = 'Radio';
if(!staticObjectArray['staticObject2']){ // The box is not stored in cookie - we need to create it.
var newIndex = createABox(1,100,false,'staticObject2',true); // true as last argument indicates that this box is not dragable
document.getElementById('dragableBoxContent' + newIndex).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + newIndex).innerHTML = titleOfNewBox;
}else{ // Box is stored in cookie - all we have to do is to move content into it.
document.getElementById('dragableBoxContent' + staticObjectArray['staticObject2']).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + staticObjectArray['staticObject2']).innerHTML = titleOfNewBox;
disableBoxDrag( staticObjectArray['staticObject2']); // Not dragable

}
hideHeaderOptionsForStaticBoxes(staticObjectArray['staticObject2']);

setTimeout('saveCookies()',100);

}

/* Disable drag for a box */
function disableBoxDrag(boxIndex)
{
document.getElementById('dragableBoxHeader' + boxIndex).onmousedown = '';
document.getElementById('dragableBoxHeader' + boxIndex).style.cursor = 'default';

}


function initDragableBoxesScript()
{
createColumns(); // Always the first line of this function
createHelpObjects(); // Always the second line of this function
initEvents(); // Always the third line of this function

if(useCookiesToRememberRSSSources)createRSSBoxesFromCookie(); // Create RSS boxes from cookies
createDefaultBoxes(); // Create default boxes.



}




window.onload = initDragableBoxesScript;

PostPosted: Sun Mar 11, 2007 7:11 pm
by Daun