Jump to content

Suggest User Contributions/Modules/Addons


RPS

Recommended Posts

I would like to dedicate this thread for suggestions on user contributions, modules, and addons.

 

Please note, this is not a feature request thread. If you would like to request a new feature, you should go to Feature Requests.

 

These suggestions are limited to non admin related functions, and should be something that a lot of people will benefit from.

 

I hope to be able to get the community to brainstorm ideas regarding additional modules/addons.

 

I'm not really a PHP programmer, but I'm more than happy to create something if I will benefit from it.

 

If you post your suggestion, and a PHP programmer believes it is something that will benefit him, then there is a good chance your suggestion will receive a solution.

Link to comment
Share on other sites

These suggestions are limited to non admin related functions

 

There's no reason to restrict this to being entirely client side. While it isn't possible to actually change any admin-side pages it isn't impossible to add to the admin area as a whole.

 

I'm also throwing in my lot as an available PHP coder :)

Link to comment
Share on other sites

I will give you guys the first idea:

 

Idea 1

Local: Admin Area

Title: IP Manager

Type: Addon Module

Description: Design a better IP Manager that besides using customer inputed IP's it also reads the already assigned IP's from the server table and adds them to the list (a kind of pre-populate)

The input fields should be:

 

- Hostname/ServerName

- Type or Description - This can be a server, a switch, a VPS, a router and so on

- Location - Datacenter or even rack and U

- IP address - Here it should be possible to have a hostname with several IP's. Example: Dedicated Server with 5 IP's assigned. Instead of entering 5 times the same information, having a relation of one to many on the Hostname -> IP address

- Notes - Free form field

 

Other things:

 

- Search by IP, Location or Hostname

- Sort by IP, Location or Hostname

 

Regards,

Link to comment
Share on other sites

Yes, it could be a drop down. But for that to work, and thinking there are endeless possibilities as there are whmcs end users, the best way to aproach this would be to setup a Location Add Form and a Type Add Form.

 

Then when adding an IP you would have only to go look into the Location and Type tables to build the drop down.

 

That would mean 2 more tables at least.

 

I hope i got my message clear..

 

Cheers and thank you for your willingness to contribute with your skills to the comunity.

Link to comment
Share on other sites

Yes, it could be a drop down. But for that to work, and thinking there are endeless possibilities

- I'd like to see a list though. There are common elements among all hosts...

 

For example:

 

- Shared Server

- Dedicated Server

- VPS

- Switch

- etc..

 

Just start out with a simple list. I already have a script that can handle a list like that.

Link to comment
Share on other sites

Yes, i agree that there are some common elements. Now imagine i am a big company and i have servers across the globe. Probably your list would not serve my interests since most likely i wanted to use other references like:

 

Shared USA

Shared UK

Shared ASIA

Dedicated GNAX

Dedicated Other Datacenter

....

and so on

 

You see now why i suggested the 2 additional tables?

 

You could go ahead and make a list.. It would look something like:

 

Shared

Dedicated

VPS

Switch

Router

Load Balancer

Firewall

Other Device

 

I think that list covers most standard options.

 

Cheers,

Link to comment
Share on other sites

Now imagine i am a big company and i have servers across the globe.

- That's why I asked for the types/description list only :P

 

Do you have a list of possible drop downs for "Type or Description"

 

I agree, the Location is something the users should enter/specify and should not be prepopulated.

Link to comment
Share on other sites

Dunno why, but the sync tables query isn't working.

 

Other than that, this should work fine.

 

Open your configuration.php file and add:

# ################################################
# added for manage ips module
# ################################################
// if the following are updated after you have installed the manage ips module, then
// you will need to click the "Update Tables" button to update the database table
$manage_ips_mod_types_list = "Shared, Dedicated, VPS, Switch, Router, Load Balancer, Firewall, Other Device"; // list all types of IPs
$manage_ips_mod_locations_list = "Phoenix AZ, Seattle WA, San Jose CA"; // list all locations of IPs
// allow user to use & see the "Sync IPs" button to grab new IPs from server list? 0 = no, 1 = yes
$manage_ips_mod_update_tables = 1;

 

Create a new folder in /modules/admin/ named manage_ips

Create a new file in /modules/admin/manage_ips/ named manage_ips.php

<?php
// used to display the different companies, products, and types
function display_list($_list){
$parts = explode(",", $_list);
for($i = 0; $i < count($parts); $i++){
	echo '<option value="'.trim($parts[$i]).'">'.trim($parts[$i]).'</option>
';
}
}

function display_list_selected($_list,$value){
$parts = explode(",", $_list);
for($i = 0; $i < count($parts); $i++){
	$s.= '
	<option '.isSelected($parts[$i],$value).'value="'.trim($parts[$i]).'">'.trim($parts[$i]).'</option>';
}
return $s;
}

function isSelected($value,$selected){
if(trim($value)==$selected){
	return 'selected="selected"';}
}

// used to display the correct values for when creating the table
function display_string($_list){
$parts = explode(",", $_list);
for($i = 0; $i < count($parts)-1; $i++){
	$s .= "'".trim($parts[$i])."', ";
}
$s .= "'".trim($parts[count($parts)-1])."'";
$s .= trim($parts[count($parts)]);
return $s;
}

// used to display the first element in the list (used for setting the default value within the database)
function display_first($_list){
$parts = explode(",", $_list);
return trim($parts[0]);
}
//$types = display_list($manage_ips_mod_types_list);
//$locations = display_list($manage_ips_mod_locations_list);

// if the table has been installed, then we can update the companies, products, and types
if($manage_ips_mod_update_tables){
if(mysql_num_rows( mysql_query("SHOW TABLES LIKE 'mod_manage_ips'"))) {
	echo '<input type="button" value="Update All Tables" onClick="window.location=\''.$modulelink.'&update=true\'" />';
	if ($_GET["update"]) {
		mysql_query("ALTER TABLE `mod_manage_ips` CHANGE `type` `type` ENUM( ".display_string($manage_ips_mod_types_list)." ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '".display_first($manage_ips_mod_types_list)."'");
		mysql_query("ALTER TABLE `mod_manage_ips` CHANGE `location` `location` ENUM( ".display_string($manage_ips_mod_locations_list)." ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '".display_first($manage_ips_mod_locations_list)."'");
		$display = 'All tables are up to date!<br />';
	}
	echo '<input type="button" value="Sync with Servers" onClick="window.location=\''.$modulelink.'&updateservers=true\'" /><br /><br />';
	if ($_GET["updateservers"]) {
		$grabIPs = mysql_query("SELECT * FROM tblservers WHERE `active`='1'");
		while($data = mysql_fetch_array($grabIPs))
		{
			//mysql_query("INSERT INTO mod_manage_ips( `id` , `ipaddress` , `note` , `type` , `location` ) VALUES(NULL, '".$data['ipaddress']."', 'NULL', '".display_first($manage_ips_mod_types_list)."', '".display_first($manage_ips_mod_locations_list)."' ) ")
		}
		$display = 'Server IPs have been synced!!<br />';
	}
	echo $display;
}
}

if(!mysql_num_rows( mysql_query("SHOW TABLES LIKE 'mod_manage_ips'"))) {
if (!$_GET["install"]) {
	echo '
<p><strong>Not Yet Installed</strong></p>
<p>This addon module allows you to record IP addresses and what they are being used for.</p>
<p>To install it, click on the button below.</p>
<p><input type="button" value="Install IP Manager" onclick="window.location=\''.$modulelink.'&install=true\'"></p>
';
} else {
	$query = "CREATE TABLE `mod_manage_ips` (`id` INT( 1 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,`ipaddress` VARCHAR( 16 ) NOT NULL ,`note` TEXT NOT NULL ,`type` enum(".display_string($manage_ips_mod_types_list).") NOT NULL default '".display_first($manage_ips_mod_types_list)."' , `location` enum(".display_string($manage_ips_mod_locations_list).") NOT NULL default '".display_first($manage_ips_mod_locations_list)."')";
	$result=mysql_query($query);
	header("Location: $modulelink");
	exit;
}
} else {
if ($_POST["ip"]) {
	foreach ($_POST["ip"] AS $id=>$ip) {
		$id = sanitize($id);
		$ip = sanitize($ip);
		$note = sanitize($_POST["note"][$id]);
		$type = sanitize($_POST["type"][$id]);
		$location = sanitize($_POST["location"][$id]);		
		update_query("mod_manage_ips",array("ipaddress"=>$ip,"note"=>$note,"type"=>$type,"location"=>$location),"id='$id'");
	}
}
if ($_POST["newip"]) {
	$newip = sanitize($_POST["newip"]);
	$newnote = sanitize($_POST["newnote"]);
	$newtype = sanitize($_POST["newtype"]);
	$newlocation = sanitize($_POST["newlocation"]);
	insert_query("mod_manage_ips",array("ipaddress"=>$newip,"note"=>$newnote,"type"=>$newtype,"location"=>$newlocation));
}
if ($_GET["delete"]) {
	$id = sanitize($_GET["id"]);
	delete_query("mod_manage_ips","id='$id'");
}
$filterfield = sanitize($_POST["filterfield"]);
$filtertype = sanitize($_POST["filtertype"]);
$filtervalue = sanitize($_POST["filtervalue"]);
echo '
<script language="JavaScript">
function doDelete(id) {
if (confirm("Are you sure you want to delete this IP?")) {
window.location="'.$modulelink.'&delete=true&id="+id;
}}
</script>
<form method="post" action="'.$modulelink.'">
<p align="center">Search for <select name="filterfield">
<option value="ipaddress"';
if ($filterfield=="ipaddress") { echo ' selected'; }
echo '>IP Address</option>
<option value="note"';
if ($filterfield=="note") { echo ' selected'; }
echo '>Note</option>
<select> that <select name="filtertype">
<option';
if ($filtertype=="starts with") { echo ' selected'; }
echo '>starts with</option>
<option';
if ($filtertype=="ends with") { echo ' selected'; }
echo '>ends with</option>
<option';
if ($filtertype=="contains") { echo ' selected'; }
echo '>contains</option>
</select> <input type="text" name="filtervalue" size="30" value="'.$filtervalue.'"> <input type="submit" value="Filter"></p>
<table width="100%" cellspacing="1" bgcolor="#cccccc"><tr bgcolor="#efefef" style="text-align:center;font-weight:bold;"><td width="120">IP Address</td><td>Note</td><td>Type</td><td>Location</td><td width="20"></td></tr>
';
$id="";
$query = "SELECT * FROM mod_manage_ips";
if ($filterfield) {
	$query.= " WHERE $filterfield";
	if ($filtertype=="starts with") {
		$query.= " LIKE '$filtervalue%'";
	} elseif ($filtertype=="ends with") {
		$query.= " LIKE '%$filtervalue'";
	} else {
		$query.= " LIKE '%$filtervalue%'";
	}
}
$query.= " ORDER BY ipaddress ASC"; 
$result=mysql_query($query);
while ($data = mysql_fetch_array($result)) {
	$id = $data["id"];
	$ipaddress = $data["ipaddress"];
	$type = $data["type"];
	$location = $data["location"];
	$note = $data["note"];
	echo '<tr bgcolor="#ffffff"><td align="center"><input type="text" name="ip['.$id.']" style="width:95px" value="'.$ipaddress.'"></td><td><input type="text" name="note['.$id.']" style="width:100%" value="'.$note.'"></td>
	<td><select name="type['.$id.']">'.display_list_selected($manage_ips_mod_types_list,$type).'</select></td>
	<td><select name="location['.$id.']">'.display_list_selected($manage_ips_mod_locations_list,$location).'</select></td>
	<td align="center"><a href="#" onClick="doDelete(\''.$id.'\');return false"><img src="images/delete.gif" width="16" height="16" border="0" alt="Delete"></a></td></tr>';
}
if (!$id) {
	echo '<tr bgcolor="#ffffff"><td colspan="5" align="center">No Data Found</td></tr>';
}
?>
</table>
<p align="center"><input type="submit" value="Save Changes"></p>
<h1>Add New IP</h1>
<table align="center">
<tr><td>IP Address:</td><td><input type="text" name="newip" size="20"></td><td>Type:</td><td><select name="newtype"><?php display_list($manage_ips_mod_types_list);?></select></td><td>Location:</td><td><select name="newlocation"><?php display_list($manage_ips_mod_locations_list);?></select></td></tr>
<tr><td>Note:</td><td colspan="5"><input type="text" name="newnote" size="75"></td><td><input type="submit" value="Add IP"></td></tr>
</table>
</form>
<?php } ?>

Link to comment
Share on other sites

I installed this but it did not grab the ips from the server.

Is there something I am missing?

 

Dunno why, but the sync tables query isn't working.

 

 

Also How do we assign IPs to clients? Is there any info or how to?

- This doesn't assign the IPs, it is only used to provide you with a way to display the IPs and have some information about the IP.

Link to comment
Share on other sites

Hi,

 

Sorry for my delay in implementing and testing this addon, but we have been busy upgrading and costumizing some stuff.

 

Installation is as easy as 123

 

Adding IP's and searching works well and no problems there also.

 

Updating the tables with new info from the config file is also working as intended.

 

Sync IP's doesn't work because the sql statement is commented out on the file..

 

All in all, it serves our purposes very well and its a really usefull tool.

 

If you want to expand on it, add a Report to list IP's. also a Hostname field would be very good, since most IP's have a hostname assign to it one way or another.

 

I have no further suggestions. Only have to say THANK YOU for sharing your efforts with us here less knowledge about PHP! THANK YOU!

 

Cheers

Link to comment
Share on other sites

ok maybe im dumb, but i followed your instructions and when i try to access the addon from the admin area i just get a blank page, please help

- You need to do it again, or check for extras lines/spaces after the code.

 

Sync IP's doesn't work because the sql statement is commented out on the file..

- That code doesn't work. Not sure why, but I don't need it enough to spend hours trying to figure it out.

 

If you want to expand on it, add a Report to list IP's

- Just a full list of all the IPs?

 

also a Hostname field would be very good, since most IP's have a hostname assign to it one way or another.

- I agree, it would be useful, however, I think the Note section is good enough. You can input the hostname inside the note section.

 

If you like, I can send you a modified script that has the hostname added to it.

Link to comment
Share on other sites

- You need to do it again, or check for extras lines/spaces after the code.

 

 

- That code doesn't work. Not sure why, but I don't need it enough to spend hours trying to figure it out.

 

 

- Just a full list of all the IPs?

 

 

- I agree, it would be useful, however, I think the Note section is good enough. You can input the hostname inside the note section.

 

If you like, I can send you a modified script that has the hostname added to it.

 

done it, twice, copied all info from ur post and still having the same issue

Link to comment
Share on other sites

I think it will be better to create a new thread for the contribution when it comes into development and this thread (where I'm posting this) is only for ideas.

 

Great to see someone giving his time and efforts for free coding :)

- Good idea :lol:

Link to comment
Share on other sites

  • 1 month later...

I would like to see a mod that allows the user to post a suggestion about the customer portal and that other users could vote for them, submit one, and view the top listing, like the one at my rackspace customer portal i attach screenshots

 

(actually what they did is to create a post on their board system managed by a java app called clearspace, and fetch that data in that page, if you browse at the board you will find all the suggestions are created by the same user, as if they were created using an api, of by email, perhaps¿¿??.?)

 

so it would be nice to create the same system but native to whmcs, the ability to submit suggestions about the cp and to review the ones implemented, and to vote for.

 

sgs1.png

sgs2.png

sgs3.png

Link to comment
Share on other sites

Looks good but won't be of high value unless you have a huge client base to get votes.

- Not only that, but you have to have WHMCS implement the changes as they are requested. I guess it is good that it promotes customer involvement, but I don't think it is a hot item, or will be used by a lot of WHMCS customers.

Link to comment
Share on other sites

This could be accomplished using the open source Digg clone pligg. It also uses smarty templates and you'd just need to bridge the user accounts... however I'm not sure how big or small a task that bridging may be to maintain single-sign on. But I agree, if you don't have 1000+ accounts, the low vote counts may give off a ghost town vibe. In any event, there's an option.

Link to comment
Share on other sites

  • 2 months later...

My thought, color coded "invoice overdue" section or contribution.

Large companies tend to have an awful lot of accounts receivable at any point in time, for example I've easily got 120 overdue invoices at the moment -- a large % of those accounts suspended as a result too though.

 

My thought is the 'invoice overdue' section needs to color-code each line based on whether the related account or service is suspended or not. For example invoices that are overdue and the related service is suspended could appear red whereas unsuspended ones could be highlighted green to pick them out of the list.

 

Just a thought.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated