Selling few php functions in wordpress to do a fix. should be simple who know it. 7$ payin

Discussion in 'Programming' started by someone100, Jun 30, 2010.

  1. #1
    one func is sometimes work sometimes not but always print :) but don't enter data to dada base.
    
    
    function findintext($namesearch)
    {
    $address='http://www.mysite.com/wp-content/themes/mytheme/k/k';
    
    
     for ($i=1; $i < 36; $i+=1) {
    $lines = file($address.$i.'.htm');
    
    foreach ($lines as $line_num => $line)
     {
        //echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
    
        if  (0<>strrpos($line,"H1")) {$linestart = strip_tags($line);}
         if   (0<>strrpos($line,' '.$namesearch)) {
              
               $linetoinsert= $linestart.strip_tags($line); 
              echo "<br>".$linetoinsert;
              add_post_meta($post->ID,'tora'.$i, $linetoinsert,false);
              
    } 
    }
       
    }
    
    }
    
    
    PHP:

    another func is working only then it isn't in the func status but stand alone.

    please send me a pm.
    thanks.
     
    someone100, Jun 30, 2010 IP
  2. gerulis

    gerulis Active Member

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    63
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    function findintext($namesearch)
    {
    global $post;
    $address='http://www.mysite.com/wp-content/themes/mytheme/k/k';
    
    
     for ($i=1; $i < 36; $i+=1) {
    $lines = file($address.$i.'.htm');
    
    foreach ($lines as $line_num => $line)
     {
        //echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
    
        if  (0<>strrpos($line,"H1")) {$linestart = strip_tags($line);}
         if   (0<>strrpos($line,' '.$namesearch)) {
             
               $linetoinsert= $linestart.strip_tags($line);
              echo "<br>".$linetoinsert;
              add_post_meta($post->ID,'tora'.$i, $linetoinsert,false);
             
    }
    }
       
    }
    
    }
    PHP:
    global $post is needed.
     
    gerulis, Jun 30, 2010 IP
  3. phpworks

    phpworks Member

    Messages:
    184
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    48
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    Job done. The problem resolved now . Payment received. Excellent Buyer
     
    phpworks, Jul 1, 2010 IP
  4. someone100

    someone100 Peon

    Messages:
    171
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    thanks a lot for phpworks.very fast solution of the problem.
     
    someone100, Jul 1, 2010 IP