<?php
/**
- *
- * SourceForge Code Snippets Repository
- *
- * SourceForge: Breaking Down the Barriers to Open Source Development
- * Copyright 1999-2001 (c) VA Linux Systems
- * http://sourceforge.net
- *
- */
-
+ * Code Snippets Repository
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge 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.
+ *
+ * FusionForge 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 FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
require_once('../env.inc.php');
require_once $gfcommon.'include/pre.php';
GROUP BY
name,snippet.snippet_id ) AS foo,snippet_version
WHERE
-snippet_version.post_date=mydate');
+snippet_version.post_date=mydate',array());
$combolistrows=db_numrows($combolistresult);
for ($i=0; $i<$combolistrows; $i++)
{
<?php
/**
- *
- * SourceForge Code Snippets Repository
- *
- * SourceForge: Breaking Down the Barriers to Open Source Development
- * Copyright 1999-2001 (c) VA Linux Systems
- * http://sourceforge.net
- *
- */
-
+ * Code Snippets Repository
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge 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.
+ *
+ * FusionForge 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 FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
require_once('../env.inc.php');
require_once $gfcommon.'include/pre.php';
time(),
htmlspecialchars($code)));
if (!$result) {
- $feedback .= _('ERROR DOING SNIPPET VERSION INSERT!');
- echo db_error();
+ $error_msg .= _('ERROR DOING SNIPPET VERSION INSERT! ').db_error();
} else {
form_release_key(getStringFromRequest("form_key"));
$feedback .= _('Snippet Version Added Successfully.');
}
} else {
- exit_error(_('Error'),_('Error - Go back and fill in all the information'));
+ exit_error(_('Error - Go back and fill in all the information'));
}
}
time()));
if (!$result) {
//error in database
- $feedback .= _('ERROR DOING SNIPPET PACKAGE VERSION INSERT!');
+ $error_msg .= _('ERROR DOING SNIPPET PACKAGE VERSION INSERT! ').db_error();
snippet_header(array('title'=>_('New snippet package')));
- echo db_error();
snippet_footer(array());
exit;
} else {
<?php
/**
- *
- * SourceForge Code Snippets Repository
- *
- * SourceForge: Breaking Down the Barriers to Open Source Development
- * Copyright 1999-2001 (c) VA Linux Systems
- * http://sourceforge.net
- *
- */
+ * Code Snippets Repository
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge 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.
+ *
+ * FusionForge 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 FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
require_once('../env.inc.php');
require_once $gfcommon.'include/pre.php';
if ($by=='lang') {
$lang = getStringFromRequest('lang');
- $qpa = db_construct_qpa ($qpa, 'AND language=$1', array ($lang)) ;
- $qpa2 = db_construct_qpa ($qpa2, 'AND snippet_package.language=$1', array ($lang)) ;
+ $qpa = db_construct_qpa ($qpa, ' AND snippet.language=$1', array ($lang)) ;
+ $qpa2 = db_construct_qpa ($qpa2, ' AND snippet_package.language=$1', array ($lang)) ;
echo '<h2>' .sprintf(_('Snippets by language: %1$s'), $SCRIPT_LANGUAGE[$lang]).'</h2>';
} else if ($by=='cat') {
$cat = getStringFromRequest('cat');
- $qpa = db_construct_qpa ($qpa, 'AND snippet.category=$1', array ($cat)) ;
- $qpa2 = db_construct_qpa ($qpa2, 'AND snippet_package.category=$1', array ($cat)) ;
+ $qpa = db_construct_qpa ($qpa, ' AND snippet.category=$1', array ($cat)) ;
+ $qpa2 = db_construct_qpa ($qpa2, ' AND snippet_package.category=$1', array ($cat)) ;
echo '<h2>' .sprintf(_('Snippets by category: %1$s'), $SCRIPT_CATEGORY[$cat]).'</h2>';
} else {
- exit_error(_('Error'),_('Error - bad url?'));
+ exit_error(_('Error - bad url?'));
}
$result = db_query_qpa ($qpa) ;
$rows=db_numrows($result);
-
$result2 = db_query_qpa ($qpa2) ;
$rows2=db_numrows($result2);
<?php
/**
- *
- * SourceForge Code Snippets Repository
- *
- * SourceForge: Breaking Down the Barriers to Open Source Development
- * Copyright 1999-2001 (c) VA Linux Systems
- * http://sourceforge.net
- *
- */
-
+ * Code Snippets Repository
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems - Tim Perdue
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge 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.
+ *
+ * FusionForge 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 FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
require_once('../env.inc.php');
require_once $gfcommon.'include/pre.php';
require_once $gfwww.'snippet/snippet_utils.php';
/*
- By Tim Perdue, 2000/01/10
-
Delete items from packages, package versions, and snippet versions
*/
exit;
}
} else {
- exit_error('Error','Error - mangled URL?');
+ exit_error(_('Error - mangled URL?'));
}
} else {
<?php
/**
- *
- * SourceForge Code Snippets Repository
- *
- * SourceForge: Breaking Down the Barriers to Open Source Development
- * Copyright 1999-2001 (c) VA Linux Systems
- * http://sourceforge.net
- *
- */
-
+ * Code Snippets Repository
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge 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.
+ *
+ * FusionForge 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 FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
require_once('../env.inc.php');
require_once $gfcommon.'include/pre.php';
} else {
- exit_error(_('Error'),_('Error - was the URL mangled?'));
+ exit_error(_('Error - was the URL mangled?'));
}
<?php
/**
- *
- * SourceForge Code Snippets Repository
- *
- * SourceForge: Breaking Down the Barriers to Open Source Development
- * Copyright 1999-2001 (c) VA Linux Systems
- * http://sourceforge.net
- *
- */
+ * Code Snippets Repository
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge 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.
+ *
+ * FusionForge 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 FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
$no_gz_buffer=true;
echo 'nothing in here';
}
} else {
- echo 'Error';
+ exit_error(_('Error'));
}
?>
<?php
/**
- *
- * SourceForge Code Snippets Repository
- *
- * SourceForge: Breaking Down the Barriers to Open Source Development
- * Copyright 1999-2001 (c) VA Linux Systems
- * http://sourceforge.net
- *
- */
+ * Code Snippets Repository
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge 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.
+ *
+ * FusionForge 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 FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
require_once('../env.inc.php');
require_once $gfcommon.'include/pre.php';
require_once $gfwww.'snippet/snippet_utils.php';
<?php
/**
- *
- * SourceForge Code Snippets Repository
- *
- * SourceForge: Breaking Down the Barriers to Open Source Development
- * Copyright 1999-2001 (c) VA Linux Systems
- * http://sourceforge.net
- *
- */
-
+ * Code Snippets Repository
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge 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.
+ *
+ * FusionForge 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 FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
require_once('../env.inc.php');
require_once $gfcommon.'include/pre.php';
if (!$result) {
//error in database
form_release_key(getStringFromRequest("form_key"));
- $feedback .= _('ERROR DOING SNIPPET PACKAGE INSERT!');
+ $error_msg .= _('ERROR DOING SNIPPET PACKAGE INSERT!');
snippet_header(array('title'=>_('Submit A New Snippet Package')));
echo db_error();
snippet_footer(array());
time()));
if (!$result) {
//error in database
- $feedback .= _('ERROR DOING SNIPPET PACKAGE VERSION INSERT!');
+ $error_msg .= _('ERROR DOING SNIPPET PACKAGE VERSION INSERT!');
snippet_header(array('title'=>_('Submit A New Snippet Package')));
echo db_error();
snippet_footer(array());
}
} else {
form_release_key(getStringFromRequest("form_key"));
- exit_error(_('Error'),_('Error - Go back and fill in all the information'));
+ exit_error(_('Error - Go back and fill in all the information'));
}
}
<?php
/**
- *
- * SourceForge Code Snippets Repository
- *
- * SourceForge: Breaking Down the Barriers to Open Source Development
- * Copyright 1999-2001 (c) VA Linux Systems
- * http://sourceforge.net
- *
- */
-
-
-/*
- Code Snippet System
- By Tim Perdue, Sourceforge, Jan 2000
-*/
+ * Code Snippets Repository
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems - Tim Perdue
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge 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.
+ *
+ * FusionForge 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 FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
$SCRIPT_CATEGORY[0]= _('Choose One');
$SCRIPT_CATEGORY[1]= _('UNIX Admin');
$SCRIPT_EXTENSION[16] = '.cs';
function snippet_header($params) {
- global $HTML;
-
if (!forge_get_config('use_snippet')) {
exit_disabled();
}
-
+ global $HTML;
+ global $feedback;
+ global $warning_msg;
+ global $error_msg;
$HTML->header($params);
+ if (!empty($error_msg)) {
+ html_feedback_top($error_msg);
+ }
+ if (!empty($warning_msg)) {
+ html_feedback_top($warning_msg);
+ }
+ if (!empty($feedback)) {
+ html_feedback_top($feedback);
+ }
+
/*
Show horizontal links
*/
function snippet_footer($params) {
GLOBAL $HTML;
- global $feedback;
- html_feedback_bottom($feedback);
$HTML->footer($params);
}
<?php
/**
- *
- * SourceForge Code Snippets Repository
- *
- * SourceForge: Breaking Down the Barriers to Open Source Development
- * Copyright 1999-2001 (c) VA Linux Systems
- * http://sourceforge.net
- *
- */
-
+ * Code Snippets Repository
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge 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.
+ *
+ * FusionForge 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 FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
require_once('../env.inc.php');
require_once $gfcommon.'include/pre.php';
$language,
$license));
if (!$result) {
- $feedback = _('ERROR DOING SNIPPET INSERT!');
+ $error_msg = _('ERROR DOING SNIPPET INSERT!');
echo db_error();
} else {
$feedback = _('Snippet Added Successfully.');
}
} else {
form_release_key(getStringFromRequest("form_key"));
- exit_error(_('Error'),_('Error - Go back and fill in all the information'));
+ exit_error(_('Error - Go back and fill in all the information'));
}
}