PDA

View Full Version : Php code inside Dynamic-FX Slide-In Menu (v 6.5)



nina simone
09-05-2010, 05:14 AM
1) Script Title: Dynamic-FX Slide-In Menu (v 6.5)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/davidmenu.htm

3) Describe problem:

I want to remove all items and let the Menu show a php code, so when a visitor passes the mouse over the menu bar, its going to get out from the left side containing enter username/password form... about the code i have the code just want to know where and how i can modify the menu script to include my php code ?

please anyone can help ?

djr33
09-05-2010, 05:23 AM
PHP is processed before the page is generated. To use "PHP code" (dynamically generated HTML content), you just need to output it (echo statement, probably) at the location where you need it in the HTML or Javascript. Then it will be there as part of the HTML for the page.

If this must automatically update after the page has been loaded then you need to use a Javascript method called "Ajax" to dynamically load PHP without refreshing the whole page.

nina simone
09-05-2010, 05:32 AM
thanks djr33
well,

Here i added <? echo $var ?> , and then renamed ssmItems.js into ssmItems.php


// ssmItems[...]=[name, link, target, colspan, endrow?] - leave 'link' and 'target' blank to make a header

ssmItems[0]=["Menu"] //create header

ssmItems[1]=["<? echo $var ?>", "", ""]

ssmItems[2]=["What's New", "http://www.dynamicdrive.com/new.htm",""]

ssmItems[3]=["What's Hot", "http://www.dynamicdrive.com/hot.htm", ""]

ssmItems[4]=["Message Forum", "http://www.codingforums.com", "_new"]

ssmItems[5]=["Submit Script", "http://www.dynamicdrive.com/submitscript.htm", ""]

ssmItems[6]=["Link to Us", "http://www.dynamicdrive.com/link.htm", ""]



ssmItems[7]=["FAQ", "http://www.dynamicdrive.com/faqs.htm", "", 1, "no"] //create two column row

ssmItems[8]=["Email", "http://www.dynamicdrive.com/contact.htm", "",1]



ssmItems[9]=["External Links", "", ""] //create header

ssmItems[10]=["JavaScript Kit", "http://www.javascriptkit.com", ""]

ssmItems[11]=["Freewarejava", "http://www.freewarejava.com", ""]

ssmItems[12]=["Coding Forums", "http://www.codingforums.com", ""]



buildMenu();



//-->

this is my php code,


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>LiveZilla - Operator Box</title>
</head>

<body>

<table cellspacing="5" style="font-family:verdana,arial;font-size:10px;border:solid 1px gray;background:#eff2f3;">

<?php

define("LIVEZILLA_PATH","./../");
require("./../api.php");
$API = new LiveZillaAPI();

foreach($API->GetOperators() as $operator)
{
if(!$operator->InExternalGroup)
continue;

echo "<tr>";
echo "<td valign=\"top\">";
echo "<img src=\"". LIVEZILLA_PATH . $operator->GetOperatorPictureFile() ."\" width=\"60\" height=\"45\" style=\"border:solid 1px gray;\">";
echo "</td>";
echo "<td valign=\"top\">";
echo "<b>" . utf8_decode($operator->Fullname) . "</b><br>". utf8_decode($operator->Description) ."<br>Status: ";

if($operator->Status == USER_STATUS_ONLINE)
echo "<span style=\"color:green;font-weight:bold;\">Online</span><br>";
else if($operator->Status == USER_STATUS_BUSY)
echo "<span style=\"color:orange;font-weight:bold;\">Busy</span><br>";
else if($operator->Status == USER_STATUS_OFFLINE)
echo "<em>Offline</em><br>";
else
echo "<em>Away</em><br>";

echo "<a href=\"javascript:void(window.open('". LIVEZILLA_PATH . FILE_CHAT . "?intid=".$API->Base64UrlEncode($operator->UserId)."&amp;mp=true','','width=600,height=600,left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes'))\">Start Chat</a>";
echo "&nbsp;|&nbsp;<a href=\"mailto:". $operator->Email ."\">Send Email</a>";

echo "<br><br></td>";
echo "</tr>";
}

?>

then how i can connect $var in ssItems.php with my php code ?

Thanks Again, and please Help :)

nina simone
09-05-2010, 10:07 AM
No Help !