Activity Stream
48,167 MEMBERS
6767 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 5 of 5
  1.     
    #1
    Member
    Website's:
    mkspot.org

    Lightbulb Wordpress - PDF using Thickbox

    Hello,
    I`m using
    Display PDF using Thickbox in a WordPress plugin. Plugin work great until you put three pdf file in one page and then will show you only one(first pdf file link - this mean when you click on other link you will se only the first pdf document other is not showed). So i found this code to show multiple pdf`s
    Code: 
    function ilc_pdfbox_thecontent ($content){
        global $post;
        global $pdfbox_width;
        global $pdfbox_height;
     
        $pdfbox_height_plus = $pdfbox_height + 15;
        $pdfbox_height += 35;
     
        $pattern = "/<a>]*).(pdf)('|\")(.*?)>(.*?)/i";
        $replacement = '<a href="#TB_inline?height='.$pdfbox_height.'&width='.$pdfbox_width.'&inlineId=ilc_pdfbox_##" rel="nofollow">Launch PDF file.</a>
            ';
        preg_match_all($pattern,$content,$matches);
        foreach($matches[0] as $k=>$v){
            $new_v = preg_replace($pattern, $replacement, $v);
            $new_v = preg_replace("!##!", $k, $new_v);
            $content = preg_replace("!".preg_quote($v)."!", $new_v, $content);
        }
        return $content;
    }
    then i click update. and i have this error on my screen


    here is orginal code
    Code: 
    function ilc_pdfbox_thecontent ($content){
        global $post;
        global $pdfbox_width;
        global $pdfbox_height;
        
        $pdfbox_height_plus = $pdfbox_height + 15;
        $pdfbox_height += 35;
        
        $pattern = "/<a(.*?)href=('|\")([^>]*).(pdf)('|\")(.*?)>(.*?)<\/a>/i";
        $replacement = '<a href="#TB_inline?height='.$pdfbox_height.'&width='.$pdfbox_width.'&inlineId=ilc_pdfbox_content" class="thickbox pdfbox">Launch PDF file.</a>
            <div id="ilc_pdfbox_content" style="display:none;"><iframe class="ilc_pdfbox_iframe" src="$3.$4" style="height:'.$pdfbox_height_plus.'px;"></iframe></div>';
        $content = preg_replace($pattern, $replacement, $content);
        //}
        return $content;
    }
    NightLightW Reviewed by NightLightW on . Wordpress - PDF using Thickbox Hello, I`m using Display PDF using Thickbox in a WordPress plugin. Plugin work great until you put three pdf file in one page and then will show you only one(first pdf file link - this mean when you click on other link you will se only the first pdf document other is not showed). So i found this code to show multiple pdf`s function ilc_pdfbox_thecontent ($content){ global $post; global $pdfbox_width; global $pdfbox_height; $pdfbox_height_plus = $pdfbox_height + 15; Rating: 5


  2.   Sponsored Links

  3.     
    #2
    Banned
    i got the same problem too. anyone help?

  4.     
    #3
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    There seems to be an error in the $pattern, the default pattern would also work fine to match hrefs ending with .pdf so
    PHP Code: 
    function ilc_pdfbox_thecontent ($content){
        global 
    $post;
        global 
    $pdfbox_width;
        global 
    $pdfbox_height;
     
        
    $pdfbox_height_plus $pdfbox_height 15;
        
    $pdfbox_height += 35;
     
        
    $pattern "/<a(.*?)href=('|\")([^>]*).(pdf)('|\")(.*?)>(.*?)<\/a>/i";
        
    $replacement '<a href="#TB_inline?height='.$pdfbox_height.'&width='.$pdfbox_width.'&inlineId=ilc_pdfbox_##" rel="nofollow">Launch PDF file.</a>';
        
    preg_match_all($pattern,$content,$matches);
        foreach(
    $matches[0] as $k=>$v){
            
    $new_v preg_replace($pattern$replacement$v);
            
    $new_v preg_replace("!##!"$k$new_v);
            
    $content preg_replace("!".preg_quote($v)."!"$new_v$content);
        }
        return 
    $content;


  5.     
    #4
    Member
    Website's:
    mkspot.org
    i change the code with your code soft2050 - thanks for help
    and i try to open...only url made changes and no open pdf box


    i dont know what to do why is this problem....


  6.     
    #5
    Member
    Website's:
    mkspot.org
    OK. I found the solution for my problem using other plugin.
    Lightbox Plus is really good plugin. You can use for gallery and also if you check


    you will have other options like




    to show pdf doc i use this link

    Using Secondary Lightbox for External Content

    Code: 
    <h4 style="text-align: center;">♦ Електрични апарати и уреди ←→
    
     <a class="lbpModal" title="Електрични апарати и уреди" 
    
     href="http://www.matura.gov.mk/data_files/state_graduate/mk/0638_Elektricni%20aparati%20i%20uredi.pdf">
    
    Here put name to be hyper link</a></h4>
    and here is what is showing on the screen

    you need only in hyper link to put class="IbpModal" - and you can have how much you want pdf doc.


    this is really cool

    if you have any question about this you can ask me


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Wordpress Article Fetch [Aka Wordpress leecher!]
    By S?nic in forum Webmaster Resources
    Replies: 2
    Last Post: 11th Apr 2012, 06:48 PM
  2. 2 themeforest Wordpress themes☼Converting A PSD To WordPress☼
    By chemicalx in forum Completed Transactions
    Replies: 0
    Last Post: 21st Feb 2012, 01:15 PM
  3. Wordpress error when disable Wordpress Seo by Yoast
    By chipve in forum Webmaster Discussion
    Replies: 8
    Last Post: 8th Jul 2011, 07:11 PM
  4. [Hiring] Expert Wordpress Coder (Wordpress Guru)
    By MasterDKR in forum Completed Transactions
    Replies: 0
    Last Post: 2nd Aug 2010, 05:07 PM
  5. [Buying] Wordpress to Wordpress Post Leecher
    By gcs89 in forum Completed Transactions
    Replies: 1
    Last Post: 23rd Jul 2010, 11:45 PM

Tags for this Thread

BE SOCIAL