topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday April 16, 2026, 3:18 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Recent Posts

Pages: prev1 ... 10 11 12 13 14 [15] 16 17 18 19 20 ... 23next
351
Developer's Corner / PHP5 driving me insane! removeChild() bug?
« Last post by Ampa on January 14, 2008, 08:29 PM »
1st: I am NOT a PHP expert. I struggle. I read a lot of help and tutorials. I understand some of them!

2nd: I found a PHP driven menu system called EasyNav - that was the easy bit.. things go downhill from this point!

I like the way that PHP is used to rewrite the site navigation, specifically removing nested menu items, and applying ID and CLASS tags to the menu to facilitate easy styling.

BUT the original script is written for PHP4 and my host uses PHP5. No problem, I thought, I'll rewrite the bits of the script that I need, and learn a lot about PHP along the way.

Generally I have got things working, but there is a bug in the code somewhere...

In one section I loop through all the UL elements in the DOM, checking to see whether their parent nodes are LI elements. If they are then the UL is a nested list, and so, unless it is the one containing the current page, should be removed from the menu.

Code: PHP [Select]
  1. $HTMLDOM = new DOMDocument();                           //Create a new DOMDocument.
  2. $HTMLDOM->loadHTML($NavHTML);                           //Convert $NavHTML to a tree of DOM objects.
  3. $ULs = $HTMLDOM->getElementsByTagname("ul");            //Get a NodeList of the <ul> elements in the document.
  4. foreach($ULs as $CurrentUL)                                     //For each <ul>...
  5. {
  6.         $ULParent=$CurrentUL->parentNode;                       //Get its parent.
  7.         if ($ULParent->nodeName=='li')                          //If parent is an <li>, then this is a nested list...
  8.         {
  9.                 if($ULParent->getElementsByTagName('strong')->item(0)==NULL)    //If the nested list does NOT contain current page.
  10.                 {
  11.                         $ULParent->removeChild($CurrentUL);     //Remove the child node. (ie the nested list).
  12.                 }
  13.         }
  14. }

To test it I run the loop on the following navigation structure...

Code: HTML [Select]
  1. <ul id="NavRoot">
  2.   <li><a href="index.php">A no_kids</a></li>
  3.   <li><a href="B.php">B 2_kids</a>
  4.     <ul id="Bsub">
  5.       <li><a href="B1.php">B.1</a></li>    
  6.       <li><a href="B2.php">B.2</a></li>    
  7.     </ul>
  8.   </li>
  9.   <li><a href="C.php">C 2_kids</a>
  10.     <ul id="Csub">
  11.       <li><a href="C1.php">C.1</a></li>    
  12.       <li><a href="C2.php">C.2</a></li>    
  13.     </ul>
  14.   </li>
  15.   <li><a href="D.php">D 2_kids</a>
  16.     <ul id="Dsub">
  17.       <li><a href="D1.php">D.1</a></li>    
  18.       <li><a href="D2.php">D.2</a></li>    
  19.     </ul>
  20.   </li>
  21.   <li><a href="E.php">E no_kids</a></li>
  22. </ul>

The current page is index.php, so ALL the sub-menus should be removed; but the actual output is...

A no_kids
B 2_kids
C 2_kids
C.1
C.2
D 2_kids
E no_kids

ie. sub-menus B and D are removed but C is not!

If I watch what is happening in the code, the foreach loop skips the iteration for C. If I comment out the removeNode() command, then the loop works correctly.

Does anyone have any idea why the removeNode() command is causing my loop to jump?
352
Post New Requests Here / Re: IDEA: Auto Frefresh New Info Notification
« Last post by Ampa on January 14, 2008, 11:20 AM »
That was my point!

Newzie can monitor normal webpages for updates.

ie. the page does not need to have an RSS feed, Newzie will look at any webpage and compare it to the last known version, highlighting any sections that have changed.

WebWatcher is another app that will do the same - but it is commercial, where Newzie is free.

I don't know how either would handle a passworded page, you'd have to try.
353
Finished Programs / Re: AltTab Fingertips v1.3 - 14 Jan 08
« Last post by Ampa on January 14, 2008, 08:59 AM »
Phew! That was fast!

Testing right now... :)

UPDATE: Looks great! I love the icon - thank you.

2 very small things...

1) The version number in the About box is wrong.
2) What is the sort order for the windows in the pop-up? Could it be alphabetical, by Application? Or even configurable?
354
Finished Programs / Re: AltTab Fingertips
« Last post by Ampa on January 14, 2008, 07:58 AM »
Decided to try this today...

1st: +1 for keeping the INI in the same folder as the script, for portability.

2nd: AVG reports "Virus Identified Worm/Autoit.LM" - I am sure that this is a false positive, but it would be rather nice if this didn't happen!

3rd: Seems very fast - thanks very much for sharing the script :)

UPDATE...

I compiled your script on my own machine, with the latest version of AHK, and AVG now likes the EXE!

4th: How about a nice icon for the tray? (Ampa doesn't like the default green H!)
355
Post New Requests Here / Re: IDEA: Auto Frefresh New Info Notification
« Last post by Ampa on January 14, 2008, 07:39 AM »
How about Newzie?

Monitor Webpages
Not all webpages have feeds so that you can subscribe to in order to get notified of updates on that webpage
Newzie can monitor normal webpages for updates. For example, you can make Newzie notify you when a new image is added. It even highlights updates to help you distinguish them at one glance
-Newzie website...
356
Videogame Development / Re: 2D/3D game developement
« Last post by Ampa on January 14, 2008, 07:33 AM »
The answers to your questions are short essays in them selves!

Games can be written in almost any language, for almost any platform, as has been proven time and again, when nerds port Tetris to Casio calculators, and Doom to dishwashers.

It really depends what sort of game you want to create: are you thinking that you want to create the next Halo / Crysis or is Line Rider / Armadillo Run more the kind of thing you are interested in?

The former take teams of a hundred people working at the cutting edge of technology for many years, while the latter will run on decade old machines, and could be written by an individual or small group of friends. The playing-field really is that open!
357
@Nosh: True, but man you should see how pimped out my training wheels are... 24crt rims, semi-precious Spokey-Dokeys - we're talking serious bling!

Ampa
358
Living Room / Re: What should I do with my audio CDs?
« Last post by Ampa on January 12, 2008, 02:12 PM »
Thanks for all the interesting input in this thread - some things I've learned...

EAC is now at v0.99 (not v.95 which I was using)
Accurate Rip is a good thing
I can rip to more than one format at once (using EAC profiles and the Compression Control Queue

All good stuff :)

Ampa
359
Living Room / Re: Pagebull - the Visual Search Engine
« Last post by Ampa on January 11, 2008, 06:49 PM »
Looks nice - interestingly a search for my name comes up with my site third (top right) but there is no screenshot (just an empty white square)

I tried the search in IE7, FF and Opera.

See for yourself HERE

I wonder why?

Ampa
360
Living Room / Re: What should I do with my audio CDs?
« Last post by Ampa on January 11, 2008, 07:56 AM »
Thanks for the replies so far - keep voting, I'll need a lot more opinions to sway me one way or the other...

Re: Lossy Vs Lossless (MP3 Vs FLAC)

I understand that MP3 is less than ideal where quality is concerned, but it is just so damned convenient! It is the one format that will just work, regardless of whether I am at home, in the car, on foot, at a friend's, on the PC, on my hifi etc.

I could certainly rip everything twice, once to the HD as FLAC and once to a data CD as MP3, but that is twice the work, twice the time...

In the end I suspect I (like most of the world) would end up sacrificing a small (?) amount of quality, for the sake of convenience.

Ampa

PS - I would at least do the ripping part properly (EAC, LAME, with high quality VBR), which must count for something?
361
Living Room / What should I do with my audio CDs?
« Last post by Ampa on January 10, 2008, 05:41 PM »
In the corner of my lounge sits my hifi, and next to that an unstable tower of CDs (about 250 in total).

This evening when I realised that I can't remember the last time I played a CD. I don't mean the last time I listened to music (I have music playing in the house everyday), but the last time that I had played music from an audio CD, taken from my shelf. Why?

Because for several years now, all my new music has been digital, in the form of MP3s.

I listen to MP3s on my computer, in the car, on a portable player, and on my hifi. So why do I keep my original CDs?

Well...

  • At one time they were my prized possessions (though now they have little or no monetary value whatsoever)
  • Because they are physical objects it feels wrong to get rid of them (a stupid hording / saving-the-planet mentality?)
  • What would / could I do with them... Car-boot sale? eBay? Charity shop?

Of course I am assuming that I would rip anything that I still enjoyed to MP3 (I realise that we are entering the murky underworld of keeping the music having scrapped the CD :redface:)

What have other DCers done with their music collections? Do you still cherish your CDs or did you sling them years ago?

Help me decide what to do with mine.

Ampa
362
Best Dialog Extender / Re: So what is the best/popular one now?
« Last post by Ampa on January 09, 2008, 07:03 AM »
I use FlashFolder, but...

FlashFolder needs Windows 2000 or Windows XP to run. Vista is not supported yet.
-From the website
363
JGPaiva's GridMove and Ahk Tools / Re: WinManagement Snap!
« Last post by Ampa on January 09, 2008, 06:59 AM »
Congratulations on your first AHK util.

The funtionality seems very similar to another AHK script that I use... WindowPad. Not a critisism, just an observation!

How does your script differ? What other features (if any) do you think you might add?

Ampa
364
From my (albeit) limited experience as a designer...

I build my pages and test in Opera first, then FireFox, followed by IE7 and finally IE6.

In the vast majority of cases: If it works in Opera, then it will work in FireFox and surprisingly well in IE7 (though a few CSS tweaks are sometimes required). IE6 invariably takes a bit more work.

My point: that by designing to be standards compliant, the work load for compatability with the other borwsers is minimal.
365
Developer's Corner / Re: AHK: ClickControl with a spinner / updown buttons
« Last post by Ampa on January 07, 2008, 10:21 AM »
Ah-ha! Yes that little tip pointed me in the right direction...

Ended up targeting the editbox rather than the spinner and sending {Up} (seems to be case sensitive).

ControlSend, Edit1, {Up}

Thanks for your help.

I shall expend on my little Wacom Helper and upload to share with others when I am done.
366
Developer's Corner / AHK: ClickControl with a spinner / updown buttons
« Last post by Ampa on January 07, 2008, 06:30 AM »
I found an AHK script HERE which toggles the active screen when using a Wacom tablet in a dual screen setup.

I am new to AHK but the script looks very basic, and I would like to improve and extend it to better serve my needs. In the first instance I am trying to replace the MouseClick commands with ControlClick which seems to respond quicker(?)

One of the controls that I need to 'click' is an updown toggle.

Wacom.png

I have tried the following...

ControlClick, msctls_updown321

and...

ControlSend, msctls_updown321, Up

but neither work (change the value in the edit box).

What am I doing wrong?

Thanks for any help / advice, Ampa.

;Wacom Helper
;by Ampa, from an original script by finchie.
!^Left::
Run C:\WINDOWS\system32\pentablet.cpl
blockinput mouse
WinWait, Pen Tablet,
IfWinNotActive, Pen Tablet, , WinActivate, Pen Tablet,
ControlClick, Button12
KeyWait Space, D
WinWait, Pen Mode Details,
ControlSend, msctls_updown321, Up
KeyWait Space, D
ControlClick, Button14
IfWinNotActive, Pen Tablet, , WinActivate, Pen Tablet,
WinClose, Pen Tablet
blockinput off
return
367
Living Room / Re: Smilie Pantomime
« Last post by Ampa on January 06, 2008, 09:38 AM »
Hmm... ok - I'm not getting it!

Dance / Rave / DJ + Grow / Salute / Attention + Fright / Shock / Surprise + Stupid / Thick / Confused

= Tinjaw?!?!

Sorry if I'm missing something really obvious here :(
368
Living Room / Re: What do you think about "What I like to do" medallions
« Last post by Ampa on January 04, 2008, 03:32 PM »
  • A loudhailer - I love to direct.
  • A questionmark - I love to perform improv
  • A storybook - I love telling stories
  • A hand - I love holding hands, and making physical contact with the people I love
  • An hourglass - I like to (?) procrastinate
369
Living Room / Re: The Best Games You've Never Played
« Last post by Ampa on January 01, 2008, 11:24 AM »
I own both Outcast and Beyond Good and Evil, and although I've completed neither, they are both outstandingly good games.
370
Living Room / Website colour: crisp and bright OR dull and sludgy
« Last post by Ampa on January 01, 2008, 10:29 AM »
Over Christmas I whipped up a small website for a local community hall. On my twin LCD displays the colours look crisp and bright, but on my mum's old CRT they look dull and sludgy (particularly in the top right hand corner).

Christie Hall website.png
Click to visit site

Now I am worried that the majority of people may be seeing the ugly version!

Please take a quick look for me and then vote above!

Thanks.

PS: anybody know the 'right' way to avoid colour discrepancies between systems. I have always assumed that my screen is giving me an accurate representation of what I have designed.
371
General Software Discussion / Re: post your 5 most used applications in 2007 here!
« Last post by Ampa on December 31, 2007, 12:32 PM »
372
Living Room / Re: Mind Manager - Worth an Upgrade?
« Last post by Ampa on December 26, 2007, 06:26 PM »
I have MM Pro v7 on my machine (WinXP SP2) and from what I recall of the update it added no new features that I regularly use.

I have MM Pro v6 on my girlfriend's machine (Vista) and it has issues! randomly disappears or stops accepting keyboard input (though the mouse / menus etc continue to work).

My advice would be to pass, unless you are on Vista and find v6 gives you stability issues.

Ampa
373
Living Room / Re: Any old Amiga users among us?
« Last post by Ampa on December 03, 2007, 08:09 AM »
I had and loved an Amiga 500 - I still fire up an emulator now and again to enjoy some of the games of my youth.
374
Developer's Corner / Re: [Wanted] Flash boardgame engine / framework
« Last post by Ampa on November 26, 2007, 11:04 AM »
Thanks for the replies guys - have downloaded both and will look into them when I have the time.

Discovered ZunTzu while browsing around which looks like an interesting alternative... it is, I suppose, a virtual table, which allows a user to move pieces on a board, and simulates dice roles etc. BUT doesn't attempt to implement any logic or rules what-so-ever, relying instead on the game players themselves to regulate the game - just like real life :)

Ampa

PS - Any other suggestions still welcomed.
375
Post New Requests Here / Re: IDEA: Auto Focus for Windows
« Last post by Ampa on November 26, 2007, 10:56 AM »
Certainly does exist... try Skrommel's Mouse Activate
Pages: prev1 ... 10 11 12 13 14 [15] 16 17 18 19 20 ... 23next