Page 25 of 25 FirstFirst ... 1522232425
Results 481 to 495 of 495

Thread: AJAX Tabs Content Script - Version 3.0 (YUI)

  1. #481

    Default

    Quote Originally Posted by bobster65 View Post
    for what version of vB?

    The MOD isn't dead, I've just not had time to support it like I've had in the past.
    I need them for vb3.7x
    Kamikage

  2. #482

    Default

    How would I call an external PHP file into a tab.

    Right now I use this markup for adding the php module of the content I want.

    PHP Code:
    <?php
    include('/services/webpages/path/public/content_folder/php_file.php');
    ?>
    The file doesn't require Clean Output...

  3. #483
    Join Date
    Mar 2006
    Posts
    587

    Default

    Quote Originally Posted by scalemotorcars View Post
    How would I call an external PHP file into a tab.

    Right now I use this markup for adding the php module of the content I want.

    PHP Code:
    <?php
    include('/services/webpages/path/public/content_folder/php_file.php');
    ?>
    The file doesn't require Clean Output...
    just like this.. see on the 3 tabs (dataSrc = the php or html file), tabsample1.php, tabsample2.php, tabsample3.php you'd use php_file.php

    its that easy..

    Code:
    <!-- YUI Tabs Display Start -->
    
    <div id="tab_container"></div>
    
    <script type="text/javascript">
    var tabView = new YAHOO.widget.TabView();
    
    	YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 1', dataSrc: 'tabsample1.php', cacheData: false, active: true }), tabView);
    	YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 2', dataSrc: 'tabsample2.php', cacheData: false }), tabView);
       	YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 3', dataSrc: 'tabsample3.php', cacheData: false }), tabView);
       	tabView.appendTo('tab_container');
    
    </script>
    
    <!-- YUI Tabs Display End  -->
    Bob
    Custom vBa & vB Mods, Installs, Configuration, DBA etc...If you need professional assistance, please feel free to PM me

    My Mods:
    [AJAX] Tabs - v3.0 (YUI) | [AJAX] Tabs - v2.0 Enhanced | [AJAX] Tabs - v2.0 | [AJAX] Tabs - v1.0

  4. #484

    Default

    I wish it was that easy. Ive tried that and variations of it many times with no displayed results.

    The file in question is not in the forum root.

    So right now Im pulling php files from mysite.com/forum/tabexample1.php
    The file I need to use is in mysite.com/gallery/tabexample.php

    Ive tried

    YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 1', dataSrc: 'gallery/tabsample.php', cacheData: false, active: true }), tabView);

    Also

    YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 1', dataSrc: 'full path to /tabsample.php', cacheData: false, active: true }), tabView);

    Also

    YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 1', dataSrc: 'full url to /tabsample.php', cacheData: false, active: true }), tabView);

    Also

    YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 1', dataSrc: 'module/tabsample.php', cacheData: false, active: true }), tabView);

    and included this to pull from the gallery dir.

    <?php
    include('/services/webpages/path/public/gally/tabexample.php');
    ?>

    Nothing works. All I get it the tab with nothing in it.

  5. #485

    Default

    This file works fine in its own module. Below is the code pulled in from the gallery directory. Of course I removed all the DB stuff but the rest unchanged.

    PHP Code:
    <?php 

    // ####################### SET PHP ENVIRONMENT ###########################  
    error_reporting(E_ALL & ~E_NOTICE);  

    // #################### DEFINE IMPORTANT CONSTANTS #######################  
    define('NO_REGISTER_GLOBALS'1);  
    define('THIS_SCRIPT''Photopost Block'); // change this depending on your filename  

    // ################### PRE-CACHE TEMPLATES AND DATA ######################  
    // get special phrase groups  
    $phrasegroups = array();  

    // get special data templates from the datastore
    $specialtemplates = array('iconcache');

    // get special data templates from the datastore  
    $specialtemplates = array();  

    // pre-cache templates used by specific actions  
    $actiontemplates = array();  

    // ######################### REQUIRE BACK-END ############################  
    require_once('./global.php');  
    require_once(
    './includes/vba_cmps_include_template.php'); 
    require_once(
    './includes/vba_cmps_global.php'); 

    // #######################################################################  
    // ######################## START MAIN SCRIPT ############################  
    // #######################################################################  



    //////////////////////////// COPYRIGHT NOTICE //////////////////////////////
    // This script is part of PhotoPost PHP, a software application by        //
    // All Enthusiast, Inc.  Use of any kind of part or all of this           //
    // script or modification of this script requires a license from All      //
    // Enthusiast, Inc.  Use or modification of this script without a license //
    // constitutes Software Piracy and will result in legal action from All   //
    // Enthusiast, Inc.  All rights reserved.                                 //
    // http://www.photopost.com      [email protected]                      //
    // Contributing Developer: Michael Pierce (danasoft.com)                  //
    //                                                                        //
    //            PhotoPost Copyright 2002, All Enthusiast, Inc.              //
    ////////////////////////////////////////////////////////////////////////////



    // *************************************************************************
    // *************************************************************************
    //PhotoPost Setting
    //You must change these values in order to run this script
    $exclude_cat ""
    $Url_Path "http://www.site.com/gallery/"//URL of your photo album, where the index.php is (with / at end)
    $data_dir "http://www.site.com/gallery/data/" //URL of your photo dir where those jpeg stored (with / at end)
    $images_dir =$Url_Path."images/"//URL of your photopost images dir where default missing thumb image is stored (with / at end)
    $rel_dir "/services/webpages/s/c/site.com/public/gallery/data/"// path to the data directory where pictures reside RELATIVE
    // to the location of THIS file (used for checking thumbs)

    //Database Setting
    //You must change these values in order to run this script
    //These value are not visible in the output page source 

    $host "host";        //Server Name
    $user"user";                  //Username
    $password"password";              //Password
    $database="db";               //Photopost database name or forum database name

    //Display Setting (Changes to fit your page)
    $q_switch "latest";            // "random" or "most_views" or "latest"
    $limit 7;                        //number of image to show
    $table_width "100%";            //width of the table generated
    $column 7;                    //number of columns of the table generated
    $photo_cell_align "center";    //alignment of those cells

    // CSS Setting (optional)
    $home[$mods['modid']]['content'] = "<style fprolloverstyle>
    A.fprolloverstyle:hover {color: red}
    .gallery_link {
    font-size: 10px; 
    white-space:nowrap;
    text-overflow:ellipsis;
    overflow:hidden;
    width:100px;

    display:block;
    }

    .gallery_table {
    border-style: none; 
    border-width: 0;  
    table-layout: auto; 
    font-size: 10px;    
    background-color:#e5e5e5;
    }
    </style>"


    $classg_link "gallery_link";                //css for link, leave blank if none
    $classg_table "gallery_table";                //css for table, leave blank if none
    $class_mouseover "#FFFFCC";    //color when mouse over the photo cell, leave blank if to cancel

    // *************************************************************************
    // *************************************************************************

    ///////////don't edit below this line if you are too afraid to kill the code//////////////
    // ---------------------- THESE FUNCS FROM pp-inc -----------------

    function mysql_query_eval$query$database ) {
        global 
    $Globals;

        
    $mysql_eval_error="";
        
    $mysql_eval_result mysql_query($query$database) or $mysql_eval_error mysql_error();
        if (
    $mysql_eval_error) {
            if ( 
    $Globals{'debug'} == ) {
                
    $letter "An error was encountered during execution of the query:\n\n";
                
    $letter .= $query."\n\n";
                
    $letter .="The query returned with an errorcode of: \n\n$mysql_eval_error\n\n";
                
    $letter .= "If you need assistence or feel this is a 'bug'; please report it to our ";
                
    $letter .= "support forums at: http://www.techimo.com/forum/f27/index.html\n\n";
                
    $letter .= "To turn off these emails, set \$debug=0 in your config-inc.php file.";

                
    $email $Globals{'adminemail'};
                
    $email_from "From: ".$Globals{'adminemail'};

                
    $subject="Subject: ".$Globals{'webname'}." MySQL Error Report";
                
    $subject=trim($subject);

                
    mail$email$subject$letter$email_from );
            }
            elseif ( 
    $Globals{'debug'} == ) {
                
    dieWell"MySQL error reported!<p>Query: $query<p>Result: $mysql_eval_error<p>Database handle: $database);
                exit;
            }
            return 
    FALSE;
        }
        else {
            return 
    $mysql_eval_result;
        }
    }

    function 
    get_ext$filename ) {
        
    $photolen strlen($filename);
        
    $RetVal substr$filename$photolen-3$photolen);

        return 
    $RetVal;
    }

    function 
    get_filename($filename) {
        
    // strip off the last 4
        
    $len strlen$filename )-4;
        
    $RetVal substr$filename0$len);
        return 
    $RetVal;
    }


    // ---------------------- THESE FUNCS FROM pp-inc -----------------
    // Connecting, selecting database
    $link mysql_connect ("$host""$user""$password") or die ('I cannot connect to the database.');
    mysql_select_db ("$database")or die("Could not select database");

    // Here is the hacked up display_gallery($q_switch)

        
    $catquery="";

        if ( IsSet(
    $cat) ) {
            
    $querya="SELECT catname FROM categories WHERE id=$cat";
            
    $catq mysql_query_eval($querya,$link);
            
    $catr mysql_fetch_array($catq);
            
    $catname $catr['catname'];
            
    mysql_free_result($catq);


            
    $queryb "SELECT id FROM categories WHERE parent='$cat' ORDER BY catorder ASC";
            
    $boards mysql_query_eval($queryb,$link);
            
    $cnt=0;
            while ( 
    $row mysql_fetch_array($boardsMYSQL_ASSOC)) {
                
    $catqid $row['id'];
                if ( 
    $cnt == ) {
                    
    $cnt=1;
                    
    $catquery .= "$catqid";
                }
                else {
                    
    $catquery .= ",$catqid";
                }
            }
            
    mysql_free_result($boards);
        }



    // Connecting, selecting database

    // Selecting method and Perform SQL query


        
    switch ($q_switch) {
            case 
    "most_views":
                if ( !IsSet(
    $cat) ) {
                    
    $group_title "Most Popular Images - All Categories";
                    
    $query "SELECT id,user,userid,cat,title,bigimage,views FROM pp_photos WHERE bigimage!='' AND approved='1' $exclude_cat ORDER BY views DESC LIMIT $limit";
                }
                else {
                    
    $query "SELECT id,user,userid,cat,title,bigimage,views FROM pp_photos WHERE bigimage!='' AND approved='1' $exclude_cat AND cat in ($catquery) ORDER BY views DESC LIMIT $limit";
                    
    $group_title "Most Popular Images - $catname";
                }
                break;
            case 
    "latest":
                if ( !IsSet(
    $cat) ) {
                    
    $group_title "Most Recent Images - All Categories";
                    
    $query "SELECT id,user,userid,cat,title,bigimage,views FROM pp_photos WHERE bigimage!='' AND approved='1' $exclude_cat ORDER BY date DESC LIMIT $limit";
                    break;
                }
                else {
                    
    $group_title "Most Recent Images - $catname";
                    
    $query "SELECT id,user,userid,cat,title,bigimage,views FROM pp_photos WHERE bigimage!='' AND approved='1' $exclude_cat AND cat in ($catquery) ORDER BY date DESC LIMIT $limit";
                    break;
                }
                break;
            default:
                if ( !IsSet(
    $cat) ) {
                    
    $group_title "Random Images - All Categories";
                    
    $query "SELECT id,user,userid,cat,title,bigimage,views FROM pp_photos WHERE bigimage!='' AND approved='1' $exclude_cat ORDER BY RAND() DESC LIMIT $limit";
                    break;
                }
                else {
                    
    $group_title "Random Images - $catname";
                    
    $query "SELECT id,user,userid,cat,title,bigimage,views FROM pp_photos WHERE bigimage!='' AND approved='1' $exclude_cat AND cat in ($catquery) ORDER BY RAND() DESC LIMIT $limit";
                    break;
                }
                break;
        }


    $i 1;
    $e 2;
    $col_val $column;
      
    $result mysql_query_eval($query,$link) or die("Query failed");
    $home[$mods['modid']]['content'] .= "<table class=".$classg_table." width=".$table_width." cellspacing='5' cellpadding='5'><tr>";
    while (
    $line mysql_fetch_array($resultMYSQL_ASSOC)) {
        
    $photo_name get_filename$line['bigimage'] );
         
    $home[$mods['modid']]['content'] .=  "<td onmouseover=this.style.background='".$class_mouseover."' onmouseout=this.style.background='' align=\"center\" valign=\"top\">";
                
    $theext get_ext$line['bigimage'] );
                
    $thecat $line['cat'];
                
    $temp_user = ($line["userid"]);
                
    $filepath "$data_dir"."$thecat/thumbs/$photo_name.$theext";
                
    $rel_path "$rel_dir"."$thecat/thumbs/$photo_name.$theext";
                
    $home[$mods['modid']]['content'] .=  "<A class=\"$classg_link\" href=\"$Url_Path"."showphoto.php?photo=".$line['id']. "\">";
                if ( 
    file_exists$rel_path ) )
                     
    $home[$mods['modid']]['content'] .=  "<img border=\"0\" src='$filepath' width='100' height='75' hspace='2'>";
                else
                     
    $home[$mods['modid']]['content'] .=  "<img border=\"0\" src='".$images_dir."nothumb.gif' alt='$filepath'>";
             
    $home[$mods['modid']]['content'] .=  "<Font size=\"1\"color=\"".$Globals{'maintext'}."\" face=\"verdana,arial\">\n";
      if (
    $q_switch == "most_views") {           
             
    $home[$mods['modid']]['content'] .=  "</a></font></div>";
             
    $home[$mods['modid']]['content'] .=  $line["user"]."<br>";
       } else { 
             
    $home[$mods['modid']]['content'] .=  "</a></font></div>";
             
    $home[$mods['modid']]['content'] .=  $line["user"]."<br>";
       }
    if (
    $i == "$column") {
    $home[$mods['modid']]['content'] .=  "</td></tr><tr>";
    $column $col_val*$e;
    $e++;
    } else {
    $home[$mods['modid']]['content'] .=  "</td>";}
    $i++;
    }
    // Closing connection
    mysql_close($link);
    // mysql_close($db_link); 
    ?>

  6. #486
    Join Date
    Mar 2006
    Posts
    587

    Default

    what do you mean "MODULE" ? This won't run a "MODULE" built to work within CMPS. Your .php file must be built to run on its own to work within the Tabs.

    That file you have above doesn't OUTPUT anything. You need to OUTPUT the CONTENT. It just builds a bunch of Variables (some of which contain HTML), but the file itself doesn't OUTPUT anything as it is.
    Bob
    Custom vBa & vB Mods, Installs, Configuration, DBA etc...If you need professional assistance, please feel free to PM me

    My Mods:
    [AJAX] Tabs - v3.0 (YUI) | [AJAX] Tabs - v2.0 Enhanced | [AJAX] Tabs - v2.0 | [AJAX] Tabs - v1.0

  7. #487
    Join Date
    Mar 2006
    Posts
    587

    Default

    This is the correct way to do it.

    Ive tried

    YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 1', dataSrc: 'gallery/tabsample.php', cacheData: false, active: true }), tabView);
    Bob
    Custom vBa & vB Mods, Installs, Configuration, DBA etc...If you need professional assistance, please feel free to PM me

    My Mods:
    [AJAX] Tabs - v3.0 (YUI) | [AJAX] Tabs - v2.0 Enhanced | [AJAX] Tabs - v2.0 | [AJAX] Tabs - v1.0

  8. #488

    Default

    That didnt work either. I need to look for a better script to pull in Photopost images.

    Ill mess with it some more and see if I cant get it going, thanks for the help so far.

  9. #489
    Join Date
    Mar 2006
    Posts
    587

    Default

    Quote Originally Posted by scalemotorcars View Post
    That didnt work either. I need to look for a better script to pull in Photopost images.

    Ill mess with it some more and see if I cant get it going, thanks for the help so far.
    What I showed you WORKS. What doesn't work is the .php file that you are using. It doesn't Display anything. You need to add in the DISPLAY part into your php file (ie, print or echo out the content) in order for it to work within this addon.
    Bob
    Custom vBa & vB Mods, Installs, Configuration, DBA etc...If you need professional assistance, please feel free to PM me

    My Mods:
    [AJAX] Tabs - v3.0 (YUI) | [AJAX] Tabs - v2.0 Enhanced | [AJAX] Tabs - v2.0 | [AJAX] Tabs - v1.0

  10. #490

    Default

    Thanks again Bob. I have an older script that works with Print and that should do the trick. For some reason it screws up the forum index so Ill only be able to use it on the homepage.

    Im no coder so how about a request.

    I would really love to see a tab with the members personal posts and threads listed. Say about 5 of each would be very cool. It could be conditional to only show when they are logged in.

    Maybe even another with all the profile blocks in one tab. Please.....

  11. #491
    Join Date
    Mar 2006
    Posts
    587

    Default

    Quote Originally Posted by scalemotorcars View Post
    Thanks again Bob. I have an older script that works with Print and that should do the trick. For some reason it screws up the forum index so Ill only be able to use it on the homepage.

    Im no coder so how about a request.

    I would really love to see a tab with the members personal posts and threads listed. Say about 5 of each would be very cool. It could be conditional to only show when they are logged in.

    Maybe even another with all the profile blocks in one tab. Please.....
    I'll see if I can fit some time in soon. Im knee deep in converting all my custom mods that I built for my own site to XenForo, so my free time is pretty used up at the moment lol
    Bob
    Custom vBa & vB Mods, Installs, Configuration, DBA etc...If you need professional assistance, please feel free to PM me

    My Mods:
    [AJAX] Tabs - v3.0 (YUI) | [AJAX] Tabs - v2.0 Enhanced | [AJAX] Tabs - v2.0 | [AJAX] Tabs - v1.0

  12. #492

    Default

    VB looses another one.

    I appreciate it Bob.

  13. #493
    Join Date
    Nov 2009
    Posts
    19

    Default

    Hi,
    I'm currently have 10 different forum blocks that list 10 threads of each on the frontpage.
    I was wondering if is possible to create a tabss scheme to switching between forums?

    I read through the article but it's too steep for me.. Could someone help me get it started?

    thanks

  14. #494
    Join Date
    Mar 2006
    Posts
    587

    Default

    Quote Originally Posted by radiofranky View Post
    Hi,
    I'm currently have 10 different forum blocks that list 10 threads of each on the frontpage.
    I was wondering if is possible to create a tabss scheme to switching between forums?

    I read through the article but it's too steep for me.. Could someone help me get it started?

    thanks
    That is exactly what this was designed for in the first place... you just need to first create the "tab" block (for the tab functionality), then you will create 10 different recent thread files and associate them with the tab block. Its pretty easy once you see how it all works together
    Bob
    Custom vBa & vB Mods, Installs, Configuration, DBA etc...If you need professional assistance, please feel free to PM me

    My Mods:
    [AJAX] Tabs - v3.0 (YUI) | [AJAX] Tabs - v2.0 Enhanced | [AJAX] Tabs - v2.0 | [AJAX] Tabs - v1.0

  15. #495

    Default

    ???

Page 25 of 25 FirstFirst ... 1522232425

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. AJAX Tabs Content Script v2.0 enhanced
    By bobster65 in forum Add-On Modules (version 3.x & 2.x)
    Replies: 568
    Last Post: 07-01-2010, 01:05 PM
  2. Slideshow and AJAX Tabs
    By glorify in forum Show off your vBadvanced!
    Replies: 5
    Last Post: 04-27-2009, 08:07 PM
  3. AJAX Tabs not rendering correct on Opera browser
    By glennybee in forum Module & Modification Discussion & Requests
    Replies: 5
    Last Post: 03-13-2008, 05:26 PM
  4. AJAX Tabbed Content Module
    By bobster65 in forum Add-On Modules (version 3.x & 2.x)
    Replies: 39
    Last Post: 09-11-2007, 01:47 PM
  5. Online Users Module (AJAX version)?
    By ERuiz in forum Module & Modification Discussion & Requests
    Replies: 1
    Last Post: 07-05-2007, 01:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •