HCCInclude A Custom API for Cpanel Version 0.1.1 beta 11/MAY/2005 © 2003,2005 Juan R. Pozo http://html.conclase.net/cp/scripts/ mailto:jrpozo@conclase.net Mailing list: http://www.conclase.net/mailman/listinfo/cpanel_conclase.net License This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Note: a copy of the GNU General Public License is available at: http://html.conclase.net/cp/scripts/license.html Installation 1) Check if the file HCCInclude.pm exists in your server inside the /usr/local/cpanel/Cpanel/ directory 2) If it exists and isn't a previous version of this API please contact me. Otherwise, follow steps 3 to 8 3) switch to root user 4) # cd /usr/local/cpanel/Cpanel/ 5) # wget –N http://html.conclase.net/cp/scripts/HCCInclude.pm 6) # chown root.root HCCInclude.pm 7) # chmod 0644 HCCInclude.pm 8) Add the following language variables to your language files: // HCCInclude (English) HCCInclude_errstr_nopipe=Couldn't fork process HCCInclude_errstr_nowget=Couldn't execute wget command // HCCInclude (Spanish) HCCInclude_errstr_nopipe=No se pudo bifurcar proceso HCCInclude_errstr_nowget=No se pudo ejecutar el comando wget API Reference Includes the specified URL. For this function to work the /usr/bin/wget program must be executable by anyone. If the process cannot be forked to open the wget command, the following variables are set: $CPERROR{'HCCInclude'} = 1 $CPERROR{'HCCInclude_nopipe'} = 1 $CPERROR{'HCCInclude_errstr'} = If the wget command is not found or cannot be executed, the following variables are set: $CPERROR{'HCCInclude'} = 1 $CPERROR{'HCCInclude_nowget'} = 1 $CPERROR{'HCCInclude_errstr'} = When using this function bear in mind that relative URLs in the retrieved document will no longer point to the correct resources, since the browser will try to complete them with the domain name that was used to load the Cpanel page. Behaves like the Include call above, but strips all contents except those enclosed inside the BODY element of the retrieved HTML document (the and tags are stripped too). Changelog 0.1.1 Beta – 11/MAY/2005 Fixed lang function to account for Cpanel's cachelang mechanism. 0.1 Beta – 24/FEB/2003 First public release. Please consider making a donation today. Visit my amazon.com wishlist at: http://html.conclase.net/link/wishlist Thank you :)