Jump to content

toasty

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Everything posted by toasty

  1. Thanks for the reply Kratsg. Someone in another forum mentioned that there might have been an issue with conflicting variables or functions between CutePHP and another script; sure enough that was the case. Took me a few hours but I was able to find the duplicated variables and after Replace All in about 13 files, I was able to rename the variable in the other script and everything seems hunky doory. Thanks again for taking the time
  2. I'm modifying a webpage that has about 3 different PHP scripts on it, so far all of them work together flawlessly. I'm trying to incorporate a blog app (cutephp), however when I perform a specific operation (adding a comment), the script fails and it outputs an error. Under normal working conditions the inclusion of the blog's code looks like this (which is NOT in the page's php header tag): <?PHP $template = "HomePage"; $number = "1"; $category = "1"; include("cutenews/show_news.php"); ?> The weird thing is that if I take cutephp's include and place it in the header, the problem with the comment goes away, however it opens up numerous other complications that would probably be even harder to work around. When I leave the code as-is, the script works great, but the comments is jacked. If I remove all the other PHP includes from the page so that only CutePHP's remains, then the blog works totally as intended. I've asked for help on the script's forum page, and while they're very helpful, they also tend to take a very long time to respond (usually). I don't imagine that anyone around here happens to know the in and outs of CutePHP's script, but I was wondering/hoping that maybe there is some general PHP practice I'm unaware of that might help. Thanks guys! The page it's being tested on is located here. - after you click the comment link at the bottom of the article and then fill out the comment form, the problem manifests when you hit the "Add comment" button.
  3. Thanks Bubblegum, I'll take a look at it and see what I can glean from it. It really seems like what I'm trying to accomplish should be easy, but like I said, my experience with coding is limited so it's all new stuff to me. If I knew how to rewrite the code I would. Initially when the script would output the datestamp for the news posts (which is what I'll be importing with the cron job if I can get it to work) it was coded to print out YYYY-MM-DD. It took me forever and a ton of forum posts to figure out how to get it do print it out in the Unix format I wanted. Here's the site that all this coding and customization is going towards.
  4. Ah, okay that sounds familiar! (My php/mysql experience is limited to reverse engineering the scripts that make my site run). So I guess what I'm looking for is what's the syntax I'd use for a cron job to insert/update the tables database? I imagine I'd have to load the applicable data into a file (csv?) and stick it somewhere on the server.
  5. The script itself handles uploading/posting/navigation for a comic and related news post. I'm basically trying to get it to do more then what it was designed for. In this thread I wasn't exactly looking for help on the script (though I'd be happy to have it), instead I'm looking to work around the script by creating a cron job that will insert data into a table of an existing database. I hope that makes some sense. If it helps at all, here's some server info: MySQL: 4.1.20-1.RHEL4.1 PHP: 4.3.9-3.22 Apache: 2.57-centos4.2.build81061129.22
  6. I'm attempting to customize a script but so far haven't had any luck. As a possible work around I thought I would create a Cron Job that would automatically upload a new record into a specific table on my MySQL database at night. But I'm not sure how to do this. I was wondering if anyone could provide me with the syntax of: 1) The cron job itself. I of course have to fill in the server/database/table specific information but I don't have any a clue where to start. 2) How should I format the .sql file (or whatever) so that it goes into the database correctly where it's supposed to and doesn't screw anything up? Here are two screen shots showing the structure and browse (from phpMyAdmin) of the specific table in the database I want to edit. If necessary at all here are some details: server: localhost table: comikaze_news I really, super, duper, insanely appreciate it guys!
  7. [quote author=HuggieBear link=topic=124299.msg515362#msg515362 date=1169988699] Do you have this code live anywhere, so we can see what you mean? Regards Huggie [/quote] I definitely realize the benefit of having a place I can showcase the issue at hand.  Right now it's in a testing location and I've been sworn to secrecy :P  However, I was able to get the code I was looking for to fix the issue at hand. Replacing:[code] $r = '<select name="comicID" onchange="location.href=\'' .$this->_config->archive_comic_url."?comicID='+value;\">";[/code] with:[code] $r = '<select name="comicID" onchange="if(this.value != \'\') location.href=\'' .$this->_config->archive_comic_url."?comicID='+value;\">";[/code] That did the trick :) Thanks for taking an interest in my plea for help Huggie, I definitely appreciate it. :D
  8. I'm in a bit of a quandary of this small snippet of code I'm trying to modify.  It's not my code, by the way :)  Anyway, this code works in a combo-box and here's the scenario that's giving me problems. The default value in the box is simply text that outputs "[Archive]".  When a user selects one of the valid entries the page is correctly redirect to a dynamic php page with the URL populated by the unique ID of whatever their selection was.  However! - and this is the problem - if after making a selection, being redirected to the page the user clicks the back button in the browser taking them back to the page with the combo box; if they make the selection of the "[Archive]" value, they are then redirected to a page (as specified in the code) but with a "blank" ID in the URL. All I want to do is make it so that if the user does click "back" and (un)intentionally selects "[Archive]" they're not redirected [B]anywhere[/B]. Here's the code that's at work (as far as I can tell): [code] <?php class ccm_archive { var $DB_PREFIX; var $_db; var $_config; var $_common; function ccm_archive($db,$dbConfig,$config,$common) { $this->_db = $db; $this->DB_PREFIX = &$dbConfig->prefix; $this->_config = &$config; $this->_common = $common; } function listComicsSelectBox($showIDs='', $reverse='', $storylines='') { $order = (empty($reverse)) ? 'ASC' : 'DESC'; $result = $this->_db->Execute("SELECT id,date,comic_title,storyline FROM {$this->DB_PREFIX}comic WHERE live='1' ORDER BY date $order"); $r = '<select name="comicID" onchange="location.href=\'' .$this->_config->archive_comic_url."?comicID='+value;\">"; $r .= '<option value="">[Archives]</option>'; while (!$result->EOF) { list ($id,$date,$title,$sl) = $result->fields; $indent = (!empty($storylines) && (!empty($sl))) ? '&nbsp;&nbsp;' : ''; $r .= "<option value=\"$id\">"; $r .= (empty($showIDs)) ? "$indent $title" : "$indent [$id] $title"; $r .= "</option>"; $result->MoveNext(); } $r .= '</select>'; return $r; } } $ccm_archive = new ccm_archive(&$ccm_db,&$ccm_dbConfig,&$ccm_config,&$ccm_common); ?>[/code] The combo box itself is called onto the page with a very simple PHP code specifying the listComicSelectBox function. Thanks for your help everyone!
  9. I'm looking for a mailinglist/newsletter script that does the following. [code] 1) Easy integration into existing webpage. 2) Upon submitting subscription one or the other of the following happens: 2a) The user is edirected to a thank you page. 2b) The user receives a pop on the exiting page saying thank you (or something.) 3) Compose mass emails in either text or HTML 4) Allows HTML in the "welcome" email (the email that's automatically sent to the user's email after registering or confirming their email address. [/code] So far I have yet to find any script that does #4 above.  It seems most scripts offer either option #1 [b]or[/b] option #2 but not both.  I've spent probably about 23 hours over the past three or four days... what day is it now?  I'm freakin' dying here.  If anyone has any suggestions about a script that does all [b]four[/b] of the above I will be so completely totally greatful. Thanks!
  10. Thanks for the suggestion Obsidian, I think I get the theory behind it.  You wouldn't by chance have any example of code I might be able to play with would you?  I've had decent reverse engineering experience with PHP but as far as actual coding I fall in the nill category. If not, that's cool, at least this gives me a little direction to head in. :)
  11. So here's my site's situation.  On one of my pages I have a flash document that acts as a music player; this flash doc is accessing .mp3 files located in sub folders on my host's (linux) server.  The way the access is setup on my site a user can't access the folder the .mp3s are located in, however if they know the file names they [b]can[/b] link directly to the .mp3s to either download them or play them directly from a browser window. I've tried chmod'ing access from the server to 700 or several variations however I haven't ended up with what I want.  It seems that the only way I can deny (via permissions) direct access to the files is to remove all but the owner permissions.  This however has the undesired effect of preventing the flash document from accessing them as well. I've also tried password protecting the folder that they're in; however anytime any page accesses the flash document (because it's located on more then one page) the browser prompts for a username/password.  Also not desireable.  I want the "protection" to be as transparent as is possible. Here's the directory structure: [code] root_folder |_index.php (the main page that uses the flash doc) |_audio_folder (contains the flash doc and audio files I want protected)   |_flash.swf (plays the music files)   |_song1.mp3   |_song2.mp3   |_songxxx.mp3 [/code] If moving the .swf out of the audio_folder is necessary to protect the .mp3s, that's fine.  I just want the player to work with transparent access to the .mp3s [b]while[/b] preventing users from directly accessing/downloading my tunes. Thanks for any help guys!
  12. I've got this mailing list app (php/mysql) that I'm working into my website and I've got it up and running and now I'm trying to make a couple modifications to the existing code. As far as I understand the code, when someone submits an email address via the <form> tag, the script runs a javascript to check whether the email addres is composed of valid characters or if it's already in the database before processing the submission.  What I want to do is configure the script so that upon a [b]successful[/b] submission an alert box pops up with a little "thank you" message (or whatever, you get the idea :) ). The existing code already throws up an alert box if the email address' format is invalid.  I think the code is in here that I want to mess with, but I'm not sure where exact because I don't really know javascript. [code]           <script language=JavaScript type=text/javascript> function checkNEmail(form) { if (isBlank(form.email.value) || isBlank(form.name.value) || !isEmailValid(form.email.value) ) { alert("Please enter a valid Name and  Email Address .\nThe email or name you have typed in does not appear to be valid."); form.email.focus(); return false; } } function checkEmail(form) { if (isBlank(form.email.value) || !isEmailValid(form.email.value) ) { alert("Please enter a valid Email Address.\nThe email you have typed in does not appear to be valid."); form.email.focus(); return false; } return true; } function isBlank(fieldValue) { var blankSpaces = / /g; fieldValue = fieldValue.replace(blankSpaces, ""); return (fieldValue == "") ? true : false; } function isEmailValid(fieldValue) { var emailFilter = /^.+@.+\..{2,4}$/; var atSignFound = 0; for (var i = 0; i <= fieldValue.length; i++) if ( fieldValue.charAt(i) == "@" ) atSignFound++; if ( atSignFound > 1 ) return false; else return ( emailFilter.test(fieldValue) && !doesEmailHaveInvalidChar(fieldValue) ) ? true : false; } function doesEmailHaveInvalidChar(fieldValue) { var illegalChars = /[\(\)\<\>\,\;\:\\\/\"\[\] ]/; return ( illegalChars.test(fieldValue) ) ? true : false; } </script> [/code] I'm not sure if this next part helps at all, but if the email turns out valid and is [b]not[/b] already in the database, then it seems that the file [u]email_not_exist.php[/u] is called which contains this: [code] <table width="100%" border="0" cellspacing="0" cellpadding="0">   <tr>     <td width="38%"><div align="center">Removal Error !!!</div></td>   </tr>   <tr>     <td>&nbsp;</td>   </tr>   <tr>     <td><div align="center"> <?php echo str_replace("{email}",$email,$lang_emailexist_adress_error); ?></div></td>   </tr>   <tr>     <td>&nbsp;</td>   </tr> </table>[/code] Thanks a lot for any ideas you all might have and I'm happy to give any more information that might help.  :D
  13. I couldn't think of where else on PHP Freaks to post for help on [url=http://wordpress.org/support/]Wordpress[/url] so here goes (and feel free to move the thread if need be). I've spent the past 8 hours today searching Google and the Wordpress forums for help on customizing my layout and so far I've turned up nothing.  The customization is bound to be simple and I'm surprised it hasn't been done already but as I said, so far I've not found anything. What I want to do is customize the archive's layout so that it's sortable by the visitors to the page.  My site has a section on video-game reviews and that's exactly what I'm using Wordpress for.  Here's the functionality I'm looking for, nice and simple: I'm trying to alter the archive so that the articles are sortable based on "custom fields" (however if there's a better way to add in fields to be sorted I'm open to suggestions).  My aim is to archive video game reviews and allow them to be sortable based upon the fields: name, date, platform (pc, ps2, xbox, etc), and rating (a decimal value: 6.5, etc). There are a couple other features I'm looking to impliment but right now I'm taking it one step at a time and I see this sorting/display issue to be my biggest hurdle. I've looked at several plugins and read through posts extensively and so far have found nothing.  I'm looking for what seems to be a very simple mod and I've been told that WP can do this no problem; but so far I'm empty handed.  If anyone knows what code needs to be changed, has examples of code, knows of plugins or anything, I could really, really use your help as I'm running out of places to look. Thanks for your time everyone!
  14. [quote author=gluck link=topic=117030.msg477214#msg477214 date=1165006225] Use an open source CMS like drupal, tikiwiki etc. [/quote] Hmmm... any idea of either/any of those do what I'm looking for right out of the 'box' or am I likely to be doing some hunting for a bunch of mods? Thanks for the suggestion Gluck!
  15. I'm looking for an application that will add some specific functionality to my website.  I'm aware that coding it myself or hiring someone to do it would achieve my desired result but both of those are currently not an option so I'm looking for something pre-baked that will get me as close to what I want as possible. Here's what I'm after: [color=#3333FF]1) Database driven (preferably MySQL) app for article storage/recalling.  Updated on the administrative level (i.e. no user input). 2) On one page it will display a specified number of the most recent articles. 3) On a seperate page will be displayed the archived articles in a sortable format (all those posted prior to those listed on the current page). 4) Clicking on any given article will open its own page. 5) Allow the archive page to roll over onto other pages when the list of articles reaches a given amount. 6) When a new article is posted, it will be listed on the "current" page, and will dynamically bump the oldest of the "new" articles onto the archive page. 7) Within the articles themselves, the option to specify page-breaks so that long articles will run over onto aditional pages. [/color] This is just a portion of my website, some added functionality I thought of that I'd like to impliment.  I was thinking that some form of blog software (Wordpress?) might be along the lines of what I'd be after, but that's just a guess. If anyone has any ideas that might help, it would be amazingly helpful!  Thanks alot everyone! - Moose
  16. Here's the code I've been screwing with for way-too-long. [code]#! /bin/sh echo "Content-type: text/plain"; echo; cd "${SITE_ROOT}/path_to_folder_of_script"; "php script.php -u http://www.__________.com/test/ -r"; echo "Script completed with exit code $?."; exit 0;[/code] The code I'm trying to run [color=orange]php script.php -u http://www.__________.com/test/ -r ;[/color] works fine and executes without a hitch from the shell.  however when I run it - [b]attempt to run it[/b] - from a browser by means of the wrapper file I continually get [color=red]Script completed with exit code 127[/color].  The code in question is a command line reindexing for my site's search engine. Any ideas?  This has been driving me insane for the past three days.
  17. My host has a very specific method for setting up cron jobs whereby the script needs to be accessible via http.  The support page has an article that details how to set this up if snippet of code wasn't developed for web-access (which is the case for all of mine) and as long as it was a 'curl' statement, I haven't had any problem... but now I'm running into a weird output because I'm trying to access a .php file .... and thus I come here seeking help :) According to the Knowledge Base article I'm told to do the following (I used all the example file names/locations for testing). 1) Create a file "web.sh" w/in the cgi-bin directory and include the following code [code] #! /bin/sh echo "Content-type: text/plain"; echo; cd "${SITE_ROOT}/var/www/html"; "${SITE_ROOT}/var/www/html/bin/example.pl"; echo "Script completed with exit code $?."; exit 0; [/code] 2) Insert the command into the /bin/example.pl file (the command for the cron job to execute) [code] php /path_to_file/search/admin/spider.php -u http://www.___________.com/_realdeal/ -r [/code] 3) That's it for the setup, to test it I just go to http://www.______.com/cgi-bin/web.sh When I do this I get one of two error messages.  "Exit Code: 126" showed up a few times until I changed the file permissions to "755".  Then, the following output is what I keep running into. [code] Status: 400 Content-type: text/html <b>Security Alert!</b> The PHP CGI cannot be accessed directly. <p>This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.</p> <p>For more information as to <i>why</i> this behaviour exists, see the <a href="http://php.net/security.cgi-bin">manual page for CGI security</a>.</p> <p>For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit <a href="http://php.net/install.windows">the manual page</a>.</p> Script completed with exit code 255. [/code] I've gone to both URL's the output's suggested and haven't been able to make any sense of it.  I'm not even sure if a "php" forum is where I need to be inquiring; but I figured since this error's only shown up when trying to run a .php file, hell it'd be a good place to start. I really appreciate any advise, tips, or solutions anyone might have.  Thanks everyone!
  18. [color=blue][size=15pt]Yes![/size][/color] That was exactly the bit of code I needed (as far as I can tell).  Sorting is still coming out the way it's supposed to be according to the Datetime field and it now looks exactly as I need it to.  Woo hoo!!  Alpine, Destruction, thank you guys soo freakin' much for your help.  Totally saved my ass.  ;D
  19. Hey wow, thanks guys!  Okay, let me see if I can complicate this scenario any further then.  The output of the $time is sent to a .tpl file via this snippet of code [code]function formatNewsPost($poster,$email,$avatar,$title,$post,$time,$comicID,$nl2br) { $post = $this->nl2brNewsPost($post,$nl2br); if (!empty($avatar)) $avatar = '<img src="' . $avatar . '" alt="' . $poster . '" border="0" />'; $replace['{NEWS_POSTER}'] = $poster; $replace['{NEWS_EMAIL}'] = $email; $replace['{NEWS_AVATAR}'] = $avatar; $replace['{NEWS_TITLE}'] = $title; $replace['{NEWS_POST}'] = $post; $replace['{NEWS_DATE}'] = $time; $replace['{COMIC_ID}'] = $comicID; return $this->_common->getTemplate('news_print.tpl', $replace); }[/code] Would I need to insert/replace the [color=red]$time[/color] variable with the [color=red]$new_timeformat[/color]? Also, with [color=blue]$time = "2005-08-18 18:24:10"; // stored time[/color], what value do I need to use?  When the news_print.tpl file calls the $time variable it's printed out with whatever timestamp is associated with the specific post. Ex: the news_print.tpl might send six seperate outputs to a single page, each having different values (as per the code above) including different timestamps. Thanks for your help guys, you've no idea how much this helps (actually, you probably do  :D )
  20. I'm not sure if what I'm trying to do is possible, or if it's as easy as I'm hoping it is.  I've got a variable [color=green]$time[/color] which has a value format in the database of [color=red]Y-m-d H:i:s[/color].  When the variable is called it has an output of the exact same format.  What I'm trying to do is retain the format of the value in the Database but change how that value's displayed on the output.  It seems like it should be really easy but for the life of my I haven't yet been able to figure it out.  ??? [size=7pt]Question's related to [url=http://www.phpfreaks.com/forums/index.php/topic,111728.msg452913.html]this post[/url][/size]
  21. On another forum someone pointed out that I should stay away from changing the way the database formats the date and time since having the format of "y-m-d H:i:s" is what allows it to be organized chronolocically.  They then raised the idea that what I want to change is not how the date/time is [b]stored[/b] but rather how it's [b]displayed[/b]. That makes perfect sense to me and thus raises the question, "how the hell do I do that?"  I know that there's a .tpl file that is used to display the date/time (in addition to several other variables). In the .tpl file it calls the variable by {NEWS_DATE}. This variable is defined in the "newsDO.class.php" file I included/referenced in my initial post around line #58 where the variable "$time" is translated to "{NEWS_TIME}". My guess is that I need to find where $time is defined or something and make some unknown change there. If the database is recording the news posts "post date" in the "y-m-d h:i:s" it's also displaying it as such... so it seem like it should be easy to tell it to display it as something else... after all, the data isn't changing.... Does anyone have any suggestions what I might have to do to achieve that? I realize I'm probably asking alot and the fact that I didn't write the script does make this a huge pain; but anyone has any suggestions it would totally help me out.
  22. What I'm trying to do with [URL=http://www.comikaze.org]Comikaze[/URL] is change the display of date/time from "Y-m-d H:i:s" to "l, M j, Y - g:ia T" (ex: Monday, Oct 16, 2006 - 3:18pm PDT).  Normally, this is something I'd expect to be able to do from the script's admin control panel however oddly enough, this is one of the variables that doesn't work when it comes to making changes to it.  Even stranger still is that if I were to believe the CP, the date/time display [b]should[/b] be "d M Y h:i a".  However as I just mentioned the date/time that is printed on the news posts follows the "Y-m-d H:i:s" format.  So changes in the CP are (unfortunately) out of the question. After checking through the script's forum and looking through the source code I was pointed to a fix that goes something like this: Step 1) Modify the code in the newsDO.class.php file from[code]Line #291: $date = $this->_db->DBDate(     $this->_common->adjustDatetimeTZOffset(date("Y-m-d H:i:s",$time)));[/code]to this[code]Line #291: $date = $this->_db->DBDate(date("l, M j, Y - g:ia T",$time));[/code]Step 2) In the MySQL database, in [COLOR=DarkRed]table: comikaze_news, field: time_posted[/COLOR]; change the type of field from: [COLOR=DarkRed]"datetime"[/COLOR] to [COLOR=DarkRed]"text"[/COLOR] and remove the [COLOR=DarkRed]default value of "0000-00-00 00:00:00"[/COLOR] By following these two steps, the date/time display works correctly however I've discovered a "snag" in the fix.  When working correctly each time a new post for a specific comic is made, the news posts are displayed top to bottom from oldest to newest (ascending order).  When this "fix" is applied, as long as the news posts for a given comic are made [I]on the same day[/I], everything works fine.  When the news posts for a given comic are posted over [b]multiple[/b] days, their placement gets completely screwed up and it no longer follows an ascending order in accordance to the date and time of the post.  The date/time still appear correctly according to the new format, but they're no longer appearing in chronological order. I was wondering if anyone might have some ideas as to how to fix this.  Ultimately, all I want is for the news posts to appear in the correct order, and for them to carry the "l, M j, Y - g:ia T" format. I tried going through every bit of code and changing all occurances of "Y-m-d H:i:s" to "l, M j, Y - g:ia T", but that didn't work.  I have a feeling it has [b]something[/b] to do with how it's interacting with the database, maybe that default value of "0000-00-00 00:00:00".  I've included the [b]default[/b] newsDO.class.php file incase anyone feels like having a look at it. If anyone has any thoughts, once again, you'd be saving my butt.  Thanks for your time and help!!  :D [attachment deleted by admin]
  23. In hind sight, 2-3 hours would have been pretty good given that I spent about 10 hours yesterday troubleshooting a (rather nice) javascript that was able to achieve what I was looking for.  It's nice having one more milestone behind me.  Thanks for the links though Huggie, I took a look at the W3 link and have a feeling I'll have use for it at some point; at the very least it's something to add to my arsenal. Thanks!
  24. The URL code is being annoying for some reason, here's the link: http//www.frequency-decoder.com/2006/09/16/unobtrusive-table-sort-script-revisited
  25. [b]Edit - Got the code from the developer[/b] I need some help modifying a script I've come across from [url=http://www.frequency-decoder.com/2006/09/16/unobtrusive-table-sort-script-revisited]here[/url].  It's a great script that allows for dynamic table sorting, my challenge is that it really screws up the appearance of my table which is very reliant on CSS.  Basically what's happened is that every [b]th[/b] that I've designated as [color=green]class="sortable"[/color] (as per the script) is having the CSS's formatting overwritten.  Through looking over some of his sample code I've determined that if I can create a sortable function I can use CSS to customize it. Example: Instead of using [color=green]class="sortable"[/color] to sort a numeric column I can create a function that does exactly the same thing but name it [color=green]class="sortable-sortNumber"[/color] and then in CSS I can customize it by using [color=green]th.sortable-sortNumber[/color]. The problem is that I have no idea, even after looking through his code, on how to create my own functions (two for numeric, two for text, one for date).  All these features are present however I need to [b]create five new functions so I can customize them[/b]. Here's an example of one of his "custom sort functions" for an IP address. [code]/*   sortIPAddress   -------------     This custom sort function correctly sorts IP addresses i.e. it checks all of the address parts and not just the first.   The function is "safe" i.e. non-IP address data (like the word "Unknown") can be passed in and is sorted properly. */ function sortIPAddress(a,b) {         var aa = a[fdTableSort.pos];         var bb = b[fdTableSort.pos];         return aa - bb; } function sortIPAddressPrepareData(tdNode, innerText) {         // Get the innerText of the TR nodes         var aa = innerText;         // Remove spaces         aa = aa.replace(" ","");         // If not an IP address then return -1         if(aa.search(/^([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})$/) == -1) return -1;         // Split on the "."         aa = aa.split(".");         // If we don't have 4 parts then return -1         if(aa.length != 4) return -1;                 var retVal = "";                 // Make all the parts an equal length and create a master integer         for(var i = 0; i < 4; i++) {                 retVal += (String(aa[i]).length < 3) ? "0000".substr(0, 3 - String(aa[i]).length) + String(aa[i]) : aa[i];         }                 return retVal; }[/code] If it helps at all here's the actual script itself in the attachment.  I know what I'm trying to do is bound to be simple as hell... I just don't know a lick of Java and I need this done in the next couple days on top of a bunch more site coding I'm working with.  Thanks a ton for any help you can spare :D [attachment deleted by admin]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.