Decaflon

Welcome to Decaflon! Where the geeks hang out: Signup or Login Here
Decaflon is proudly hosted by (mt) Media Temple.  We recommend them for your web hosting needs.

Sebastiano's Activity Stream: Page 1 of 1 « FIRST  ‹ PREV  NEXT ›  LAST »

» Share Your Twitter Names  ...  Last Reply: 1 month ago by jongos.

And here I am Have the account from some time now, but never bothered using it..

Anyway it took about 20 minutes to go through this list, so show me some love and follow me to..ok?

^-^

» javascript problem again, adding values up  ...  Last Reply: 10 months ago by posure.

Oli:

I've cut out the duplicate getElementById because it's an expensive call. If you're referencing a DOM element over and over again, keep a pointer variable stored for it.

Thanks for that tip, i'll keep it in mind!

Mike:

And just as a reference, if you have a number and you + "" to it, it automatically converts to a string.

yep that I find-out the hard way! lol, anyway thanks for pointing it out.

so basically using pointer values shortens up your code, and when using numbers we have to use parseint() to convert string to integer.. ..

.......right? lol... I wanna learn, but i get confused with php functions and it's way of handling values

» Best/Easiest Ways To Learn PHP Programming?  ...  Last Reply: 10 months ago by roolersbcak.

hmm, I suggest that you go to hotscripts.com search in the PHP section what you want to add on your website, look and play with the code and see what happens, that is how i learned php, beside of that i can suggest a nice book about php, PHP5 & MySQL Bible.

Having Dreamweaver won't help you much except for the collor reference while programming, you could use even notepad if you want.

Last tip. find a community by programmers for programmers where you can ask all questions about functionality, if you do it on 9rules , some have great knowledge to help you.

» javascript problem again, adding values up  ...  Last Reply: 10 months ago by posure.

oh great I'll try that, thanks Oli !

I just came up with this

document.getElementById("rightTextPosition").value = (barPosition * 1) + (2 * 1);
and it works, but is not logic....
I'll go for your option ^_^

and god I hate JavaScript, but sometimes we just HAVE to use it, to get some interactive fast-response without (re)loading a page... beside of that i'm a php guru !

8

javascript problem again, adding values up

Programming Community — Posted: Feb. 19, 2008  ...   Last By: posure @ 10 months ago

okay here it is


var barPosition = 25;
document.getElementById("rightTextPosition").value = barPosition;
document.getElementById("rightTextPosition").value += 2;

end result of this is 252, and not 27 ....WHY ?!

and this

var barPosition = 25;
document.getElementById("rightTextPosition").value = barPosition;
document.getElementById("rightTextPosition").value -= 2;

end result is 23 and that is correct..

I probably know the answer somewhere in my messy head, BUT at the moment I have no clue....

» What company name should a merged Microsoft/Yahoo have?  ...  Last Reply: 10 months ago by wrttnwrd.

LOL at carmodyarc. I like the shortness of your name, but is suitable,since Microsoft really doesn't need Yahoo! and Yahoo should migrate with Microsoft since the are a nostalgic company on the web.....

1

new PC new websites new ideas

Technology Community — Posted: Feb. 2, 2008  ...   Last By: Heliophage @ 11 months ago

Since I've lost all my project data when my "old" notebook gave up and started to smoke, I've got more ideas than before, I'm going to give up all my old project and plan to work around ezion.cc Which will be my new place for my portfolio mainly, my main concern is the design, I showed it to my sister and the first thing she said to me is "it looks like 9-11" and "war-like" I didn't intend to design it that way, the main idea behind the theme/layout is Liberty and Freedom (libirty the statue, I placed it in that way, not to make it fall, but to show that good and evil are equilibrated. Freedom are the guys jumping out of the airplane , I had many more ideas but this was the cleanest way to work with, the about and portfolio are there but their page is not filled yet I did this on purpose because first I'd like to know what you think of it.

Note that the "centerbox" and "sidebox" stay as they are, The div has a set height and autoscroll once the output is larger that the current set height.

please let me know what you think of it! Any ideas/comments are welcome.

^-^ Sebastiano

» What company name should a merged Microsoft/Yahoo have?  ...  Last Reply: 10 months ago by wrttnwrd.

I think YaMi is a nice name

» Posting to WordPress without using wp-admin  ...  Last Reply: 11 months ago by fedmich.

I'm not much into WP but normally it's easier to write a small script, that contains a simple form with the fields you need , on submission the data you inserted will be saved directly into the database. basically the same way hackers do with old versions of phpbb and phphuke/postnuke.

but why you want to do this ? I mean this file needs some authentication to, which you get from the database as well. in the end you can work it into 1 file. using functions from wp is tricky since you script probably won't be in the same folder as the wp-admin, meaning relative paths to files and folders are different.

» Do You Know Any Good Book On PHP & MySQL  ...  Last Reply: 11 months ago by Sebastiano.

i second PHP.NET and online tutorials, I have 6 books about PHP which I hardly use really, a book normally gives you 2/3 examples in how you can use a function , on the web you can find loads of examples (yes also bad ones) but at the end everything about PHP/MySQL is documented online, with more examples and in 99% of the problems you have while programming a website or whatever someone on the otherside of the world already solved that problem and can be found on php.net in the user comments. you could also check phpclasses for solutions and about.com hold a few basic php tutorials..

Anyway if you insist in a book i recommend THE PHP5 and MySQL Bible but i'm not sure it will suit the biginner, but it covers all main and basic aspects about php5 and MySQL

» Wordpress, Custom Fields and a Plugin, Oh my!  ...  Last Reply: 1 year ago by Sebastiano.

$postpic value is "Array"

hmm, try this print_r($postpic,true) now all array values will be shown. something like

ARRAY (
url => some url
id => some id nr
)

now when we know what the url is,and can call it with something like $postpic["url"]

or if the array does not have the identifiers

ARRAY (

some url,some id nr,something else
)

it'll be something like this $postpic["0"]
and instead of 0 count at what place the url is, and take 1 of. so if the url is the fifth value it should be 4

anyway this

ARRAY (
some url,some id nr,something else
)

is unlikely, it probably will be displayed as

ARRAY (
0 => some url
1 => some id nr
)

This should help you a little further!

» HELP! PHP: Regular expression with preg_match  ...  Last Reply: 1 year ago by Sebastiano.

okay another problem less in the world, it's fixed.

Basically you can do Lookahead with regex and I did not know this, anyway here is the solution to the code posted before :

function callback($buffer)
{
$level = levelfix(); // ie. ../ || ../../../
$buff = preg_replace("1(src)=(['\"])((?:(? return ( $buff );

}
ob_start("callback");

hope it's usefull to someone

1

HELP! PHP: Regular expression with preg_match

Programming Community — Posted: Nov. 11, 2007  ...   Last By: Sebastiano @ 1 year ago

Hmm, sorry for the weekly posts with me asking for help, but it makes me feel better when I share my coding problems with you.

here is the fuzz :
I have to change the image src value before processing the page to the browser

I'm buffering the page with ob_start("callback");
now the callback function looks like this
function callback($buffer)
{
$level = levelfix();
// replace all the image tags

$imagesrc = "src=\"";
$buff="";
$buff.= str_replace($imagesrc, "src=\"".$level.$image, $buffer);
return ( $buff );
}

And this works good so far, here is the catch, It should not modify the image source if the url is full.
ie. it should change this :
but not this

I hope someone holds the knowledge.

» Ajax: http_request.send problem  ...  Last Reply: 1 year ago by Sebastiano.

okay, have it fixed now, after some more reading I've found out php only handles POST if it is formatted in the right way, that is a valid ARRAY. i'm my case this was not wrong and i changed this: theStr += ele.name + ' : ' + ele.value + "n"; to this : theStr += ele.name + ' = ' + ele.value + "&"; and now it is working like it should.

» Ajax: http_request.send problem  ...  Last Reply: 1 year ago by Sebastiano.

thanks Mike, I'm going to try that asap. thanks for the thoughts

3

Ajax: http_request.send problem

Programming Community — Posted: Oct. 31, 2007  ...   Last By: Sebastiano @ 1 year ago

Hi, It's getting a usual weekly posting habbit with my coding problems. I usually don't go into Ajax because I'm really not good at it but I have to following problem, I'd like to "Post" some values with Ajax/JS but it does not work.


function update_form(myForm) {
http_request = false;
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) {
try {
http_request = new ActiveXObject("Msxm12.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Error create XMLHTTP instance');
return false;
}

theForm = document.getElementById('theform');
theStr = '';
for (i=0; i < theForm.elements.length; i++) {
ele = theForm.elements[i];
theStr += ele.name + ' : ' + ele.value + "n";
}

url = "administration_ajax.php?update=ajax_adm_centerboxes.php";
http_request.onreadystatechange = update_form2;

http_request.open('POST', url, true);

http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http_request.setRequestHeader("Content-length", theStr.length);
http_request.setRequestHeader("Connection", "close");

http_request.send(theStr);
}

function update_form2() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
document.getElementById('status').innerHTML = http_request.responseText;
} else {
alert('Have problems loading new page');
}
}
}

Everything works fine, file is called like it should, but the "POST" data does not arrive. I've tried with "GET" and it arrives good, but i cannot use it, because the URL length might exceed. therefor I really need to find out how to get this to work, and am sure someone knows the answer out here on 9r.

» What screen saver are you using?  ...  Last Reply: 5 months ago by RightOn.

no screensaver. Monitor will switch off after 15 minutes, unless h'm watching a movie or two ^-^
Beside I've noticed from the above post, that some use the screensaver to gather information through rss or YouTube. my question now is: "Do you actually wait 10 minutes till the screensaver comes up?" and what if you accidentally move the mouse, you start over again?

» Need a little help with joomla  ...  Last Reply: 1 year ago by eddie7.

It's not too complicated…

True, I've got the site setup just as i wanted to... anyway thanks for the replay, better late then never :)

^-^

» How Do You Stay Organized?  ...  Last Reply: 1 year ago by Sebastiano.

jark wrote:
I stay organized by being distinctly disorganized. Utter chaos seems to be far more organized that true organization is. Or so I keep telling myself anyways!

I lol'd... why ? Its the same thing i wanted to say, I'm going to post a picture of my computer room, but anyone could actually loose himself in this chaos.
Anyway back to the topic.

I don't think there is a way to get organized more or less, I have a good memory it if comes to items and where i placed them. if it comes to phone-numbers and names I am a complete mess, I used to store everthing in my phone, persons # , adress the whole thing. btw if you are to organized it's easier to get fired, because someone else could takeover your job easily, if it is a mess your boss won't fire you knowing it would take weeks to figure out what you where working on ^-^ thats my theory .

» HELP: Moving MD5 encryption from 1 field to another  ...  Last Reply: 1 year ago by Sebastiano.

okay have it almoust working now, anyway here is the hash.salt work around...

$form_password = the value you send with the form.
$storedPassword = the value in the database

list( $pass, $salt ) = explode( ":", $storedPassword );
$form_password = md5( $form_password . $salt );
$form_password = $form_password .":".$salt;

now $form_password is equal to $storedPassword and all should work perfectly ! i hope

» HELP: Moving MD5 encryption from 1 field to another  ...  Last Reply: 1 year ago by Sebastiano.

hmm, oli thanks for the help , there was actually a problem with the script.

You where right about the salting, joomla is all over it... (I hate that)..
and WP seems to double md5 hash the passwords ? hmm well this is going to take all night, for me it is the first time to work with joomla & wordpress, I am used to homebrewed scripts, phpwebthings and phpnuke(eeww).... and I haven't coded anything at all last 2 months, so it is a little complex...

after 1 hour of searching in the wp files i finally found where the actual piece of code is where we validate user login.. now i'm going to try to implent the salting technique joomla is using...

» HELP: Moving MD5 encryption from 1 field to another  ...  Last Reply: 1 year ago by Sebastiano.

hmm, actually I don't think that is the problem . the weird thing is, if I take a value from a field, and drop it into another field, why is the value being changed?

here is a piece of the code:

$stmt_j = "SELECT * FROM ".$table_joomla." ";
$ret_j = mysql_query($stmt_j)or die("Could not successfully run query ($stmt_j) from DB: " . mysql_error()) ;
while ($row = mysql_fetch_array($ret_j)) {
$username = $row["username"];
$password = $row["password"];
$email = $row["email"];
$registerDate = $row["registerDate"];
$stmt_w = "SELECT * FROM ".$table_wp." WHERE user_login = '".$row["username"]."' ";
$ret_w = mysql_query($stmt_w)or die("Could not successfully run query ($stmt_w) from DB: " . mysql_error()) ;
if (mysql_num_rows($ret_w) == 0) {
$stmt_insert = "INSERT INTO ".$table_wp."
SET user_login = '$username',
user_pass = '$password',
user_email = '$email',
user_registered = '$registerDate' ";
$ret_insert = mysql_query($stmt_insert)or die("Could not successfully run query ($stmt_insert) from DB: " . mysql_error()) ;
}
}

You would expect that both password fields would match now, but this is not the case...

7

HELP: Moving MD5 encryption from 1 field to another

Programming Community — Posted: Oct. 13, 2007  ...   Last By: Sebastiano @ 1 year ago

HI,
Okay here is what i want to do.
I'm running Joomla & Wordpress Multi on a server, now there is no script to let the joomla user create automatically an account with the WP installation, therefor I've written a little script, to match users from the joomla user_table to the wordpress usertable, if the user does not exist, then he will be added to the wordpress table...

Now everything is working ok, except for the password field.
I can extract the md5 hash correcty, but when i try to fill the wordpress password field the md5 is being altered... any idea how to fix this?

basically i can pull it out right , putting it back somewhere else isn't working.

Hope someone can help with this...

Ty,
Sebastiano ^-^

4

Need a little help with joomla

Programming Community — Posted: Oct. 12, 2007  ...   Last By: eddie7 @ 1 year ago

Hi there,

I've started to explore the world of joomla, to see it's functionalities and features, but now im stuck on a part i cant figure out.

I want to create a top-login // Top- User menu instead of using the sidebox ones, For what I've understood , this has to be hard coded in the template, the only problem is, HOW to create the top menu.....

If someone holds the answer, or know where I can get some information about this, please let me know..

damn the CMS I program for is for sure less powerfull,but Joomla is complicated....or atleast from my first point of view

ty ^^

1

Good Guide to become a Programmer.

Programming Community — Posted: Oct. 10, 2007  ...   Last By: hthth @ 1 year ago

okay, the title says it all!

How to be a Programmer: A Short, Comprehensive, and Personal Summary

I'm not sure if this is real or not, but I'm not going to read all this, I leave it up to one of you, it would be nice if you told me if it was usefull . well here you go Guide: How to become a programmer!

Happy Reading ^_^

0

Apple Ipod 30gb vs Creative Zen 30gb

Technology Community — Posted: Oct. 10, 2007

You guys all talk about Ipods.... stop it!, Does any off you have a creative Zen Vision W like me?? I feel a little lonely here.... anyone wanna buy it from me .... *lol*

The creative Zen Vision is a little bigger than the Ipod Video and also a little ticker, but I used it this summer on the beach and was great for video/music/radio , it has a voise recorder memo and organizer...

the big size is mainly due to the compact flash card reader, handy if you have a digital fotocamera like my brother-in-law (we previewed pictures on the zen for it's higher resolution screen ) 640 x 480 screen (versus 320 x 240 for the iPod)...

Well I like the Zen, sounds more relaxing too, but it might end up on ebay...

[edit: sorry wrong category..stupid me..bangs head against wall]

» Mac iPod - backup on XP?  ...  Last Reply: 1 year ago by Sebastiano.

Well you can backup manually , I have done it 2 years ago (something less) for a friend of mine, it's a pain in the but though, attach your ipod to the pc, and browse the pod's folders, untill you find all kind of folders with weird-named.mp3 songs in it, copy them to your pc, and you have a raw backup of your ipod, but this is not what you want i think...
okay while writing here i found this : link Media Monkey
Keep A special note on step 6... that is what i did back in the day...

^-^ hope it works for you to

0

Php Developer looking for work/project paid or not

Programming Community — Posted: Oct. 8, 2007

Hi,
Not sure if this post is allowed here but I'll give it a shot. I'm a programmer/coder in php/mysql and in my free time all i do is read about php or flex small projects on my own, but lately I'm very very bored, so if anyone is looking for a php-coder programmer I'll join your project.

my website : Lonelymind.com

"lifetime project" :PhpWebThings
I've learned php/mysql working on phpwebthings and am one of the administrators of the project,but the project is pretty coming to an end (sadly) and therefor looking for another home, besides phpwebthings to improve my skills and stay up to date with new ways of coding, of thinking..

Well Who wants me to help ? contact me ^-^

» online php note  ...  Last Reply: 1 year ago by Sebastiano.

As a Developer (Php/Mysql) mainly for web-apps I think becoming a master in a developing language is very difficult? Why ? There are many ways to code/design/program an application, when you know all the ways to accief a final result then you are a master.
anyway if you need help or got stuck with some code, contact me, I'll see to get you back on track again.

Sebastiano's Activity Stream: Page 1 of 1 « FIRST  ‹ PREV  NEXT ›  LAST »

All Of Sebastiano's Decaflon Activity:

  • New Notes: 9
  • Comments: 20
  • New Clips: 0
  • Total Clip Votes: 0
  • Positive Clip Votes: 0
  • Negative Clip Votes: 0
 

Decaflon is part of the Chawlk Network of sites.

9 Great Places To Visit, Hang Out, & Meet New People

What's new and interesting at other Chawlk Network sites: