Jump to content

toasty

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

toasty's Achievements

Member

Member (2/5)

0

Reputation

  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
×
×
  • 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.