Feature Request - sort of...

Support and feedback for UniAdmin

Feature Request - sort of...

Postby skifter22 » Tue Feb 27, 2007 4:53 pm

:thumright: First - I love UA and UU - great job on these guys... and way to make a Guild Master/Web Master's life tons easier! :thumleft:

I was wondering if I might trouble you guys for a snippet of code...

I'd like to display a list of add-ons in our UA system on my webpage without directing users to the UA page itself. Essentially I'd like to be able to slap the table from the AddOns page (with it's download and description links and status indicators [unchangeable]) onto a page on the guild site. I'd prefer not to direct guildies and guests to the uniadmin page (mainly because I consider it to be 'administrative' and I like to keep that stuff behind a curtain - it's not even linked to the main page) - but I would like to give my guildies more information about what they're getting in the add-ons pack and what's available in the optional add-ons.

I understand you guys are busy - and this could certainly be accomplished by manually writing the tables and information onto the webpage... was hoping for a more convenient (and easily updateable) method of presenting this information to the guildies. I tried slicing out the code I thought would work, but I am apparently not quite skilled enough to get the job done. I think alot of GM's would find a feature like this pretty useful.

Thanks!
User avatar
skifter22
WR.net Apprentice
WR.net Apprentice
 
Posts: 15
Joined: Thu Jan 04, 2007 9:42 pm

Feature Request - sort of...

Postby foreseit » Tue Feb 27, 2007 5:19 pm

Hm... I second this request. Some PHP code would be great.
<a href="thehateguild.com"><img src="/anetheron/addons/siggen/sig.php?name=Foreseit"></a>
User avatar
foreseit
WR.net Journeyman
WR.net Journeyman
 
Posts: 139
Joined: Tue Jul 25, 2006 10:03 pm

Re: Feature Request - sort of...

Postby Ansgar » Tue Feb 27, 2007 5:50 pm

I write this one based on Uniadmin code 0.7.0 but still working with the new release, you only need to supply your own information regarding database, username, password, hostname, table_prefix as for UniAdmin:

Code: Select all
<?php

$config['host'] =    'hostname';   // dbase host
$config['username'] = 'username';   // dbase username
$config['password'] = 'password';   // dbase password
$config['database'] = 'database';   // dbase name
$config['db_prefix'] = 'uniadmin_75_';

$config['db_tables_addons'] = $config['db_prefix'].'addons';
$config['db_tables_files'] = $config['db_prefix'].'files';
$config['db_tables_logos'] = $config['db_prefix'].'logos';
$config['db_tables_settings'] = $config['db_prefix'].'settings';
$config['db_tables_stats'] = $config['db_prefix'].'stats';
$config['db_tables_users'] = $config['db_prefix'].'users';
$config['db_tables_svlist'] = $config['db_prefix'].'svlist';
//////////////////////// FOLDER SETTINGS //////////////////////////
$config['addon_folder'] =    'addon_zips';
$config['temp_analyze_folder'] = 'addon_temp';
$config['logo_folder'] = 'logos';
////////////////////////// OTHER STUFF ////////////////////////////
$config['ziplibsupport'] =   false;
$config['UAVer'] =                'Beta 0.7.0';
$config['debugSetting'] =   true;
$url = explode('/','http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
array_pop($url);
$url = implode('/',$url).'/';
$config['URL'] =               $url;
$config['IntLocation'] =          $config['URL'].'interface.php';

$dblink=mysql_connect($config['host'],$config['username'],$config['password']);
mysql_select_db($config['database'],$dblink);

$AddonPanel = "<?xml version='1.0' encoding='ISO-8859-1'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' dir='LTR'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1' />
<meta http-equiv='Content-Style-Type' content='text/css' />

<title>Alliance Réunifiée :: Liste des Addons maintenus sur le site</title>
</head>
<body>
<a name='top' id='top'></a>

      
      <table class='uuTABLE' border='1'>
         <th colspan='8'><center>Liste des Addons</center></th>
         <tr>
            <td><center><b>Name</b></center></td>
            <td><center><b>Version</b></center></td>
            <td><center><b>TOC</b></center></td>
            <td><center><b>Uploaded</b></center></td>
            <td><center><b>URL</b></center></td>
            <td><center><b>Required?</b></center></td>
            <td><center><b>Active?</b></center></td>
         </tr>";

$sql = "SELECT * FROM `".$config['db_tables_addons']."` ORDER BY `name`";
$result = mysql_query($sql,$dblink);

while ($row = mysql_fetch_assoc($result)){

         $sql = "SELECT * FROM `".$config['db_tables_files']."` WHERE `addon_name` = '".addslashes($row['name'])."'";
         $result2 = mysql_query($sql,$dblink);
         $numFiles = mysql_num_rows($result2);
         $AddonName = $row['name'];
         $homepage = $row['homepage'];
         $version = $row['version'];
         $toc = '';
         if ($row['toc'] == "20000") {
            $toc = "Ready 2.0";
         }
         $time = date("M jS y H:i",$row['time_uploaded']);
         $url = $row['dl_url'];
         $addonID = $row['id'];
         if ($row['homepage'] == ""){
            $homepage = "./";
         }
         $required = "No";
         if ($row['required'] == "1"){
            $required= "Yes";
         }
         $enabled = "No";
         if ($row['enabled'] == "1"){
            $enabled = "Yes";
         }
         $AddonPanel .="
         <tr>
            <td><a target=_blank href=\"$homepage\">$AddonName</td></a>
            <td>$version</td>
            <td>$toc</td>
            <td>$time</td>
            <td><a href='$url' target='_BLANK'>DownLoad</a></td>
            <td>$required</td>
            <td>$enabled</td>
         </tr>
         ";
//      }
}
$AddonPanel .= "</table>";
echo("   <br>
      <br>
      <center>
         $AddonPanel
         <br>
         <BR>
         <BR>
      </center>");
?>
Ansgar
WR.net Apprentice
WR.net Apprentice
 
Posts: 26
Joined: Wed Jul 05, 2006 7:12 pm

Feature Request - sort of...

Postby zanix » Tue Feb 27, 2007 5:55 pm

I tried to made UniAdmin so that visitors can just look at some of the pages without being logged in for this exact reason

Try looking at your UniAdmin pages without being logged in and see if that poses a security risk
Last edited by zanix on Tue Feb 27, 2007 6:13 pm, edited 2 times in total.
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Feature Request - sort of...

Postby Carasak » Tue Feb 27, 2007 5:59 pm

phpcode example to get a table with all addons
hope that serves you
Attachments
addonlist_v0.1.zip
shows addons provided by unidamin
(691 Bytes) Downloaded 62 times
User avatar
Carasak
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 114
Joined: Tue Aug 15, 2006 2:33 am
Location: Spain

Re: Feature Request - sort of...

Postby skifter22 » Tue Feb 27, 2007 7:19 pm

zanix wrote:Try looking at your UniAdmin pages without being logged in and see if that poses a security risk


That works just fine, I realize that was the intent... I was just looking for something that was small and could snap into a page on the site - mainly for aesthetics... the UniAdmin pages don't exactly fit within the theme of my guild site. Most of my guildies don't care about the nuts and bolts, but would like to get more information on the specific add-ons that are required and available - I'm looking for an easy solution to kepping a descriptor page up-todate without having to enter data more than once... since UA does it for you it'd be easier to simply recall that data into another table.


Ansgar - thanks for the clip - I'm getting an error though:

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <path to file> on line 61

Line 61 is: "while ($row = mysql_fetch_assoc($result)){"


Carasak - I tried that clip too, but it returns an error of "No database selected"



Any further help I could get would be immensly appreciated.

Thanks!
Last edited by skifter22 on Tue Feb 27, 2007 7:20 pm, edited 1 time in total.
User avatar
skifter22
WR.net Apprentice
WR.net Apprentice
 
Posts: 15
Joined: Thu Jan 04, 2007 9:42 pm

Re: Feature Request - sort of...

Postby Carasak » Tue Feb 27, 2007 7:24 pm

did you follow the instructions?


add your db connection data
line 10: $footer_dblink = $wowdb->connect(hostname, databaseuser, database pass, database name);
change:
yourUNIADMIN_ADDONSTABLE: change with name of your table line 13

and make sure that on line 9:
require_once('/roster/lib/wowdb.php');
you actually point to your roster installation
Last edited by Carasak on Tue Feb 27, 2007 7:27 pm, edited 1 time in total.
User avatar
Carasak
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 114
Joined: Tue Aug 15, 2006 2:33 am
Location: Spain

Feature Request - sort of...

Postby Ansgar » Tue Feb 27, 2007 8:01 pm

I think that the issue is the same with my code you need to supply your parameters in

$config['host'] = 'hostname'; // dbase host
$config['username'] = 'username'; // dbase username
$config['password'] = 'password'; // dbase password
$config['database'] = 'database'; // dbase name
Ansgar
WR.net Apprentice
WR.net Apprentice
 
Posts: 26
Joined: Wed Jul 05, 2006 7:12 pm

Re: Feature Request - sort of...

Postby skifter22 » Tue Feb 27, 2007 8:02 pm

Carasak -

I did leave out the db name. After correcting that issue I now get:

Incorrect table name '.UA_TABLE_ADDONS.'

Below are lines 9 through 14 of the code you sent as I modified it (I blanked out the username and password info)

Code: Select all
   require_once('wowdb.php');
   $footer_dblink = $wowdb->connect('localhost', '<username>', '<password>', '<dbname>');


$results = $wowdb->query("SELECT * FROM `.UA_TABLE_ADDONS.`") or die(mysql_error());
?>


I simply copied the wowdb.php file into the directory in which I am testing the code(hence I removed the extraneous path data) - could that be the source of the problem?

Thansk for all of your help!
User avatar
skifter22
WR.net Apprentice
WR.net Apprentice
 
Posts: 15
Joined: Thu Jan 04, 2007 9:42 pm

Feature Request - sort of...

Postby skifter22 » Tue Feb 27, 2007 8:47 pm

I have corrected the issue in both sets of code.

Ansgar - had to remove the "_75" from "$config['db_prefix'] = 'uniadmin_';" in line 7

I get the table now, but not without errors -
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in <path to file> on line 65

Line 65 is:
$numFiles = mysql_num_rows($result2);



Carasak - I had the incorrect table referenced in the code.

:thumright: Thank you both for your help!! :thumleft:

Thanks,

-Jason
(Timok - Echo Isles - Alliance)
http://www.freekngihtsalliance.com
User avatar
skifter22
WR.net Apprentice
WR.net Apprentice
 
Posts: 15
Joined: Thu Jan 04, 2007 9:42 pm

Re: Feature Request - sort of...

Postby Carasak » Wed Feb 28, 2007 10:50 am

show us your working result =)
User avatar
Carasak
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 114
Joined: Tue Aug 15, 2006 2:33 am
Location: Spain

Feature Request - sort of...

Postby skifter22 » Wed Feb 28, 2007 12:39 pm

No problem!

Here is the page that the table is on:
http://www.freeknightsalliance.com/addons.php

Thanks again for all of your help!

-Jason
User avatar
skifter22
WR.net Apprentice
WR.net Apprentice
 
Posts: 15
Joined: Thu Jan 04, 2007 9:42 pm

Feature Request - sort of...

Postby zanix » Thu Mar 01, 2007 2:09 am

Nice
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Feature Request - sort of...

Postby MattM » Thu Mar 01, 2007 5:39 am

skifter22 wrote:No problem!

Here is the page that the table is on:
http://www.freeknightsalliance.com/addons.php

Thanks again for all of your help!

-Jason


easy on the eyes, nice job!
MattM
UA/UU Developer
UA/UU Developer
Gimpy Developer
Gimpy Developer
 
Posts: 886
Joined: Tue Jul 04, 2006 9:53 pm
Location: USA

Feature Request - sort of...

Postby zanix » Sun Mar 04, 2007 10:29 pm

Another way to do this is to parse the XML output of interface.php

The url to get the addon list is
Code: Select all
uniadmin/interface.php?OPERATION=GETADDONLIST
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US


Return to UniAdmin

Who is online

Users browsing this forum: No registered users and 0 guests

cron