PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
testy1
Involved
Involved


Joined: Apr 06, 2008
Posts: 483

PostPosted: Thu Jan 15, 2009 11:21 pm Reply with quote Back to top

soooooooooooooooo Smile

This question is specific to ravennuke 2.3 really

I have some jquery I want to add that is used in a block.It will also have a switch via the database to turn it on and off.next there is some options (css) that I would like to set via the administraion area for the block.

My question is what is the best method for doing this, Hopefully the code below will help fill in the gaps

In the header (or a file associated with the header) i need the following, but to allow the database switch's I also need to include the function to get the values.I dont want to clutter up the jquery.php file so should I put this in a file on its own and call it from the header.......

Could I have some opinions on how you would do it please......


Code:


/*************************************/
/* Grab The Settings           START */
/*************************************/

$dfw_getsets = array();
$dfw_getsets = dfw_getblockcfg();

function dfw_getblockcfg()
{
      global $prefix, $db;
      $getcfg = array();
      $sql = 'SELECT * FROM `' . $prefix . '_dfw_cfg`';
      $result = $db->sql_query($sql);
      if (!$result) {
            echo '' . _DBCALLERROR . '';
      } else {
            while (list($cfg_nm, $cfg_val) = $db->sql_fetchrow($result)) {
                  $getcfg[$cfg_nm] = $cfg_val;
            }
            return $getcfg;
      }
}
/*************************************/
/* Grab The Settings             END */
/*************************************/
if ($dfw_getsets['tooltip'] == 1) {
// Define some variables
$BdrThickness = (!empty($dfw_getsets['border_thickness']) ? 'intval($dfw_getsets['border_thickness'])' :  '0');
$BdrType = (!empty($dfw_getsets['border_type']) ? 'intval($dfw_getsets['border_type'])' :  'none');
$BdrColor = ((strlen($dfw_getsets['border_type']) == 7) ? $dfw_getsets['border_type'] : '#FFFFFF');

echo '<script type="text/javascript" src="includes/jquery/jquery.js"></script>';
echo '<script type="text/javascript" src="includes/jquery/jquery.tooltip.js"></script>';
echo '<link rel="stylesheet" type="text/css" href="includes/jquery/css/jquery.tooltip.css" />';

echo '<style type="text/css">
#tooltip.DFWClass {
   font-family: Arial;
   border: ' . $BdrThickness . 'px ' . $BdrType . ' ' . $BdrColor . ';
   padding:20px;
   opacity: 0.8;
}
</style>';

echo '<script type="text/javascript">
$(function() {
  $(\'#DFWSite a\').tooltip({
   /* Do Something */
   /* Do Some more */
   /* automatically fix yourself */
  });
});
</script>';
}
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16976
Location: Kansas

PostPosted: Thu Jan 15, 2009 11:45 pm Reply with quote Back to top

If you look at header.php you will see that we have an include_once 'includes/jquery/jquery.php'; for a specific use in Your_Account module. You should be able to do the same kind of call for your specific use.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
testy1
Involved
Involved


Joined: Apr 06, 2008
Posts: 483

PostPosted: Fri Jan 16, 2009 12:21 am Reply with quote Back to top

ok, will there be some way of standardizing how we include jquery in future releases as there could be a lot of double, triple, quad (you get the point) includes


EDIT: or is there a way to check if a block is loaded easily like we can modules
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16976
Location: Kansas

PostPosted: Fri Jan 16, 2009 12:27 am Reply with quote Back to top

Absolutely. We are/were trying different methodologies and we are still in the process of formalizing a lot of things/stuff Wink. However, we are trying to balance releases with documentation, standards, etc. and as you yourself know all too well, so little to do and so much time Shocked Confused - stop; reverse that - so much to do and so little time killing me
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
testy1
Involved
Involved


Joined: Apr 06, 2008
Posts: 483

PostPosted: Fri Jan 16, 2009 12:32 am Reply with quote Back to top

lol I here ya all to well m8 Smile
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum