News:

Please note these forums are mostly a testing ground for my SMF work and I don't really use them otherwise.

Main Menu

Recent posts

#81
PasteBin / Paste-1274408579:v:use_geshi-1...
Last post by Guest - May 21, 2010, 02:22 AM
<?php

phpinfo();

?>
#82
PasteBin / Paste-1274041547:v:use_geshi-1...
Last post by SleePy - May 16, 2010, 08:25 PM
[*****@**** ~]$ ping simplemachines.org
PING simplemachines.org (10.0.100.134) 56(84) bytes of data.
64 bytes from 10.0.100.134: icmp_seq=1 ttl=64 time=0.894 ms
64 bytes from 10.0.100.134: icmp_seq=2 ttl=64 time=0.215 ms
64 bytes from 10.0.100.134: icmp_seq=3 ttl=64 time=0.282 ms

--- simplemachines.org ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.215/0.798/1.899/0.779 ms
#83
PasteBin / Paste-1273966662:v:use_geshi-1...
Last post by SleePy - May 15, 2010, 11:37 PM
<?php

$tests = array(
   "123456",
   "123456\n",
);

foreach($tests AS $test)
{
   $good = preg_match('~^[0-9]+$~', $test);

   echo '"', $test, '" ', $good ? 'is' : 'is not', ' good
';
}

?>
#84
PasteBin / Paste-1273494370:v:use_geshi-0...
Last post by Guest - May 10, 2010, 12:26 PM
Hello friends!
I want to invite you all to play with me at GP Latale Online - GamesPirate.com.


If you want to join me in this great game, or you want to join one of the other games that GamesPirate.com has,
please click on the following links:
Main Site: http://gamespirate.com
Forums: http://forum.gamespirate.com
Game Site: http://latale.gamespirate.com

Note:
This message was provided by "GP Latale" to be used in our advertising system.
We take no responsibility for the misuse of this system.
#85
PasteBin / Paste-1273100106:v:use_geshi-1...
Last post by SleePy - May 05, 2010, 10:55 PM
<?php
// SETTINGS
   // Simple Desk Tables.
   $sd_tables = array('tickets', 'ticket_replies', 'log_action', 'log_read', 'attachments');

   // SMF Tables we need to clean up after.
   $smf_tables = array('log_mark_read', 'log_notify', 'log_actions', 'log_activity', );

   // My settings brings all the coders to the yard...
   $reset_settings = array(
      'shd_staff_badge' => 'nobadge',
      'shd_display_avatar' => 0,
      'shd_disable_action_log' => 0,
      'shd_ticketnav_style' => 'sd',
      'shd_allow_ticket_bbc' => 1,
      'shd_allow_ticket_smileys' => 1,
      'shd_enabled_bbc' => 1,
      'shd_helpdesk_only' => 0,
      'shd_attachments_mode' => 'ticket',
      'shd_disable_pm' => 0,
      'shd_disable_mlist' => 0,
      'shd_bbc' => implode(',', $bbc_tags),
      'shd_staff_ticket_self' => 1,
      'shd_privacy_display' => 'smart',
      'settings_updated' => time(),
   );

   // The default topic title.
   $topic = 'Welcome to the SimpleDesk Demo';

   // The default topic body.
   $message = 'Welcome to the SimpleDesk Demo.

We have provided this demo forum as a means to allow you to demo our software.



SimpleDesk Administrator login: Admin / admin

SimpleDesk Staff user login: Staff / staff

SimpleDesk Regular user login: User / user
';

// Join us, SMF.
require_once('SSI.php');

// Clean the tables.
foreach ($sd_tables as $table)
   $smcFunc['db_query']('', 'TRUNCATE {db_prefix}helpdesk_{raw:table}', array('table' => $table));

// Collect bbc.
$bbc_tags = array();
foreach (parse_bbc(false) AS $tag)
   $bbc_tags[] = $tag['tag'];

// Update the Settings table.
updateSettings($reset_settings);

// Clean the SMF topics and messages, leaving only default.  This is done because posts are allowed for move to topic/ticket feature
$smcFunc['db_query']('', 'DELETE FROM {db_prefix}topics WHERE id_topic > 1', array());
$smcFunc['db_query']('', 'DELETE FROM {db_prefix}messages WHERE id_msg > 1', array());

// Reset the auto-increment count.
$smcFunc['db_query']('', 'ALTER TABLE {db_prefix}topics AUTO_INCREMENT = 1', array());
$smcFunc['db_query']('', 'ALTER TABLE {db_prefix}messages AUTO_INCREMENT = 1', array());

// Clean any SMF logs such as read log pretaining to topics and messages caused by SD actions.
foreach ($smf_tables as $table)
   $smcFunc['db_query']('', 'TRUNCATE {db_prefix}{raw:table}', array('table' => $table));

// Do the actual change to message table.
$smcFunc['db_query']('', '
   UPDATE {db_prefix}messages
      SET
         subject = {string:topic},
         body = {string:message},
         id_msg_modified = 1,
         poster_name = {string:name},
         poster_email = {string:email},
         poster_ip = {string:ip},
         smileys_enabled = 1,
         modified_time = 0,
         modified_name = {string:empty},
         icon = {string:xx},
         approved = 1,
         id_member = 0,
         poster_time = {int:time}
   WHERE id_msg = 1',
      array(
         'topic' => $topic,
         'message' => $message,
         'name' => 'SimpleDesk Team',
         'email' => 'void@simpledesk.net',
         'ip' => '127.0.0.1',
         'empty' => '',
         'xx' => 'xx',
         'time' => (int) strtotime('Janurary 1st, 2010'),
      )
   );

// Now topics table.
$smcFunc['db_query']('', '
   UPDATE {db_prefix}topics
      SET
         is_sticky = 0,
         id_first_msg = 1,
         id_last_msg = 1,
         id_member_started = 0,
         id_member_updated = 0,
         id_poll = 0,
         id_previous_board = 0,
         id_previous_topic = 0,
         num_replies = 0,
         num_views = 0,
         locked = 0,
         unapproved_posts = 0,
         approved = 1
   WHERE id_topic = 1', array());

// TODO: Fail checks, email webmaster@simpledesk.net on errors and return false for error handler to show a message (Need to setup that email address first [HA!])

// For now this just redirects.
redirectexit();

return true; exit;
?>
#86
PasteBin / Paste-1270950807:v:use_geshi-1...
Last post by SleePy-uBuntu - Apr 11, 2010, 01:53 AM
# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# Note that some configuration settings that could be done previously
# in this file, now are automatically configured by the server and settings
# here are ignored.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
#   sudo dpkg-reconfigure -phigh xserver-xorg

Section "Device"
   Identifier   "Configured Video Device"
EndSection

Section "Monitor"
   Identifier   "Configured Monitor"
EndSection

Section "Screen"
   Identifier   "Default Screen"
   Monitor      "Configured Monitor"
   Device      "Configured Video Device"
EndSection
#87
PasteBin / Paste-1270674004:v:use_geshi-1...
Last post by SleePy - Apr 07, 2010, 09:00 PM
   // Defaults.
   require_once($sourcedir . '/Subs-SimpleDesk.php');
   $context['helpdeskTickets'] = array(
      'open' => shd_count_helpdesk_tickets('open', true),
      'waiting' => shd_count_helpdesk_tickets('staff', false),
   );
#88
PasteBin / Paste-1270672511:v:use_geshi-1...
Last post by SleePy - Apr 07, 2010, 08:35 PM
   // Tickets awaiting response.
   $request = shd_db_query('
      SELECT COUNT(id_ticket)
      FROM {db_prefix}helpdesk_tickets AS hdt
      WHERE {query_see_ticket} AND status IN (0,1)', array());
   if ($smcFunc['db_num_rows']($request) > 0)
      list($context['helpdeskTickets']['waiting']) = $smcFunc['db_fetch_row']($request);
   $smcFunc['db_free_result']($request);
#89
PasteBin / Paste-1269205203:v:use_geshi-1...
Last post by SleePy - Mar 21, 2010, 09:00 PM
The-SleePy-Laptop:simpledesk jeremy$ diff -u /home/svn/simpledesk/trunk/scripts/helpdesk.js /home/smf/public_html/helpdesk/Themes/default/scripts/helpdesk.js
--- /home/svn/simpledesk/trunk/scripts/helpdesk.js   2010-02-28 08:27:39.000000000 -0800
+++ /home/smf/public_html/helpdesk/Themes/default/scripts/helpdesk.js   2010-03-21 13:57:44.000000000 -0700
@@ -206,4 +206,11 @@
    document.getElementById(this.opt.sHeaderId).setAttribute('class', (this.bCollapsed ? 'titlebg grid_header' : 'titlebg'));
 
    this.bCollapsed = !this.bCollapsed;
+}
+
+// The quick jump function
+function shd_quickTicketJump(id_ticket)
+{
+   window.location.href = smf_prepareScriptUrl(smf_scripturl) + '?action=helpdesk;sa=ticket;ticket=' + id_ticket;
+   return false;
 }
\ No newline at end of file
The-SleePy-Laptop:simpledesk jeremy$ diff -u /home/svn/simpledesk/trunk/template/SimpleDesk.template.php /home/smf/public_html/helpdesk/Themes/default/SimpleDesk.template.php
--- /home/svn/simpledesk/trunk/template/SimpleDesk.template.php   2010-03-20 13:28:57.000000000 -0700
+++ /home/smf/public_html/helpdesk/Themes/default/SimpleDesk.template.php   2010-03-21 13:57:41.000000000 -0700
@@ -37,11 +37,12 @@
                <span class="upperframe"><span></span></span>
                <div class="roundframe">
                   <div class="shd_gototicket smalltext">
-                     <form action="', $scripturl, '?action=helpdesk" method="post">
+                     <form action="', $scripturl, '?action=helpdesk;sa=ticket" method="get">
                         ', $txt['shd_go_to_ticket'], ':
-                        <input type="text" name="ticket" size="4" />
-                        <input type="submit" value="', $txt['shd_go'], '" />
+                        <input type="hidden" name="action" value="helpdesk" />
                         <input type="hidden" name="sa" value="ticket" />
+                        <input type="text" id="ticketJump" name="ticket" size="4" />
+                        <input type="submit" value="', $txt['shd_go'], '" onclick="shd_quickTicketJump(this.parentNode.ticketJump.value);" />
                      </form>
                   </div>
                   <div id="welcome">
#90
PasteBin / Paste-1268761867:v:use_geshi-1...
Last post by SleePy - Mar 16, 2010, 05:51 PM
// SleePy is lazy, so I will just check to see if db_query exists
if(!function_exists('db_query'))
{
   db_extend('Packages');
   function db_query($query, $file, $line)
   {
      global $smcFunc;
      return $smcFunc['db_query']('', $query, array('db_error_skip' => true));
   }
}
// All work here is for back support for SMF 1.1, It is easier to support 2.0 and backport.
else
{
   $smcFunc = $func;
   $smcFunc['db_num_rows'] = 'mysql_num_rows';
   $smcFunc['db_free_result'] = 'mysql_free_result';
   $smcFunc['db_fetch_assoc'] = 'mysql_fetch_assoc';
   $smcFunc['db_list_columns'] = 'mysql_show_columns';
   $smcFunc['db_add_column'] = 'mysql_create_columns';

   // Quickly emulate these functions.
   function mysql_show_columns($table_name)
   {
      global $smcFunc, $db_prefix;

      $result = db_query("SHOW FIELDS FROM {$table_name}", __FILE__, __LINE__);;
      $columns = array();
      while ($row = $smcFunc['db_fetch_assoc']($result))
         $columns[] = $row['Field'];
      return $columns;
   }
   function mysql_create_columns($table_name, $column_info)
   {
      global $db_prefix;

      return db_query('ALTER TABLE ' . $table_name . '
         ADD ' . $column_info['name'] . ' ' . $column_info['type'] . ' ' . (empty($column_info['null']) ? 'NOT NULL' : '') . ' ' .
      (empty($column_info['default']) ? '' : 'default \'' . $column_info['default'] . '\'') . ' ' .
      (empty($column_info['auto']) ? '' : 'auto_increment') . ' ', __FILE__, __LINE__);
   }
}