Jump to content

SkyRanger

Members
  • Posts

    738
  • Joined

  • Last visited

Posts posted by SkyRanger

  1. Having a problem since the time change of 1 hour.

     

    Times now show 2:08 when it is 3:08

     

    I am using:

    date_default_timezone_set('EST');
    
    date('g:i a');
    

     

    Any way to fix this to show corrent time?

  2. Thanks.  I figured out how to remove it and it fixed the problem.  Thanks again

     

    Oh anybody that has this problem.  Go into the code right click choose encoding...  Choose unicode(UTF-8) and ensure that add BOM is unchecked.

  3. Ok, not sure what the problem is....hard to explain.  I am trying to setup a login script but I get the normal: Warning: session_start() [function.session-start]: Cannot send session cache limiter error code.  I have no white space above to cause problem.  I have used this same code written by Jpmaster77 on a number of sites.  What the strange thing is it also messed up a couple of my css text boxes.   

     

    See the difference: 

    http://www.monstersgonewild.ca/index.php - Problem

    http://www.monstersgonewild.ca/index1.php - Without session()

     

    I would post the code of the original page but it is 600+lines and growing.

     

    Anybody have any ideas?

     

  4. k, I am dumb as a brick.  If it wasn't for PFMaBiSmAd helping me with the initial PHP code.  I would still be pulling out my hair to figure it out.  Does anybody know where I can find a tutorial to even start to try and figure out what I need to do.

  5. Can somebody please have a look at this.  The Problem I am having is that only 1 entry for each month goes into the tree and for the life of me I can't figure out why.

     

    $queryyp = "SELECT YEAR(date) as year, MONTHNAME(date) as month, title FROM monsterpost ORDER BY date DESC"; // query to get the rows you want in the order that you want them, with the year and monthname specifically selected as well
    $resultyp = mysql_query($queryyp);
    $last_heading = null; // remember the last heading (initialize to null)
    while($rowyp = mysql_fetch_assoc($resultyp)){
    $new_heading = $rowyp['year']; // get the column in the data that represents the heading
    $new_subheading = $rowyp['month']; // get the column in the data that represents the subheading
    if($last_heading != $new_heading){
    	// heading changed or is the first one
    	$last_heading = $new_heading; // remember the new heading
    	$last_subheading = null; // (re)initialize the subheading
    	// start a new section, output the heading here...
    	echo "<ol class=\"tree\"><li><label for=\"folder1\">{$rowyp['year']}</label> <input type=\"checkbox\" id=\"folder1\" /></li></ol>";
    }
    // subheading under each heading
    if($last_subheading != $new_subheading){
    	// subheading changed or is the first one
    	$last_subheading = $new_subheading; // remember the new subheading
    	// start a new section, output the subheading here...
        	echo "<ol><li><label for=\"subfolder1\">{$rowyp['month']}</label> <input type=\"checkbox\" id=\"subfolder1\" />";
    
    }
    // output each piece of data under a heading here...
    echo "<ol><li class=\"file\">{$rowyp['title']}</li></ol></li></ol></li></ol>";
    }
    
    

  6. I know I am probably pushing my luck.  Been playing with the code trying to do different things with it.  Is there a way to separate the month.  If I am being to much of a bother just say figure it out yourself......lol

     

    2012

    March

    entry

    entry

     

    February

    entry

    entry

     

    Trying to put it in a drop down menu now....but thank you again for you help.

  7. OMG PFMaBiSmAd  That is exactly what I needed.  That works perfectly.  I owe you BIG time.  This would have taken me a month to even get a start on figuring out how to do that.  I have been picking away at it and reading over the other posts since you posted last.  Again thank you.

  8. Thanks PFMaBiSmAd.  But after staring at the examples you gave.  I am more lost than I was before....lol.... I am a real noob when it comes to complex php code.  Doing the basics like showing everything in the table is about all I can do. Thanks for your help anyhow.  Hopefully over time and allot of practice I will figure it out.

  9. I am trying to get a group by to work but for some reason it will only display one output.  Not sure what the problem is.

     

    mpid  mpyear mpmonth mpday  mptitle
      4       2012      3             2        Text stuff here
      3       2012      3             1        Day 1 stuff here
      2       2012      2             28      Feb stuff here
      1       2011      12           27      First post test here
    
    
    So what I am trying to do is sort out per year month
    
    ie:
    
    2012
    3
    Text stuff here
    Day 1 stuff here
    2
    Feb stuff here 
    2011
    12 
    First post test here

     

    That is what I eventually want it to look like, but first thing I need to do is get atleast the mptitle to group first.

    $query = "SELECT * FROM monsterpost group BY 'mpmonth'"; 
    
    $result = mysql_query($query) or die(mysql_error());
    
    // Print out result
    while($row = mysql_fetch_array($result)){
    echo $row['mptitle'];
    echo "<br />";
    }
    ?>
    
    

  10. Ok.  Thought I fixed the problem but guess not.  Changed the tables to work a little easier but still not working.

     

    This is the problem I am having.

     

    Table Data:

     

    mpid  mpyear mpmonth mpday  mptitle

      4      2012      3            2        Text stuff here

      3      2012      3            1        Day 1 stuff here

      2      2012      2            28      Feb stuff here

      1      2011      12          27      First post test here

     

     

    So what I am trying to do is sort out per year month

     

    ie:

     

    2012

    3

    Text stuff here

    Day 1 stuff here

    2

    Feb stuff here 

    2011

    12 

    First post test here

     

    This is what I have tried with now luck just repeats  year month title for each entry
    
    $resulty = mysql_query("SELECT * FROM monsterpost order by mpid desc limit 1")
    or die(mysql_error());
    while($rowy = mysql_fetch_array( $resulty )) {
    

     

    Any help would be greatly appreciated.

  11. Hello, not sure if lack of sleep or just staring at code too long.

     

    This is what I have:

     

    while($rowy = mysql_fetch_array( $resulty )) {
    mpdate = YYYY-MM-DD
    $date = $rowy['mpdate'];
    
    $year = explode('-', $date);
    $month = date("F", mktime(0, 0, 0, $year[1]));
    ?>
    
    <?php echo $year[0]; ?>
    <br>
    <?php echo $month; ?>
    <br>
    <?php echo $rowy['mptitle']; 
    }
    ?>
    
    I figure if I use:
    
    if ($year[0] == date('Y"){
    
    echo month and entry stuff
    
    }
    but I keep getting errors.
    

     

    What I am trying to do is sort everything out into year month and day

     

    ie:

     

    2012

    March

    Entry 1

    Entry 2

    February

    Entry 1

    Entry 2

    Entry 3

    etc...

     

    This is what I am getting

     

    2012

    March

    Entry 1

    2012

    March

    Entry 2

    2012

    February

    Entry 1

    etc...

     

    Is there a way to fix this?

     

     

     

  12. Hello,

     

    I seem to be having a problem.  I am trying to extract the year from a date

     

    2012-03-01
    echo "2012";
    
    I have tried this and it only displays 1969
    
    $dateorig = "2012-03-01";
    $new_year = date("Y", strtotime($dateorig));
    echo $new_year;
    

     

     

     

  13. I am trying to convert Numbers to months from mySQL.  What I current have in my db is smonth = #

     

    What I am trying to figure out is if there is a way to do an array that will convert the # to a month instead of use if $smonth = 1 echo January.

     

    Any help is greatly appreciated and thank you in advance.

  14. Hi Guys,

     

    This is what I am trying to do.  I have multiple link one 1 page and when a user clicks on that link it will print that file for them.

     

     

    page.php containts 20+ images
    
    image1 - Print
    image2 - Print
    image3 - Print
    etc....
    
    <a href="page.php?cid=1">Print</a>
    <a href="page.php?cid=2">Print</a>
    <a href="page.php?cid=3">Print</a>
    
    

    So what I need to do is if user clicks cid=2 then it goes to page.php?cid=2 shows the image and prints with javascript.

     

    That is not a problem I already to this with html but I am changing over to php mysql due to simplicity and ease of use. and also to reduce to pages from 30+ pages down to 1 page for this section.

     

    so this is what I am having trouble with

    
    switch($cid)
    case $cid
    {
    echo image and print
    }
    default {
    echo all images and print link
    }
    

     

    So the problem I am having is the case $cid

     

    The problem is that this is so simple and I have been playing with it for so long I don't see the fix.

  15. Figured it out, for 1 thing, had the stuff backwards, and second should have used !empty instead of isset:

     

    $eventstart = $rown['starttime'];
    if(!empty($eventstart)) {
         echo $rown['starttime'];
    } else {
         echo "All Day";
    }
    

  16. I am having a problem trying to show if cell is empty echo one thing if empty and starttime if there is one:

     

    if(isset($rown['starttime'])) {
              echo "Add Day";
                 } else {
              echo $rown['starttime'];
                 }
    

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