Sponsored Content
The Lounge What is on Your Mind? Temporarily Disabled MySQL Update for Man Pages Post 303040464 by Neo on Wednesday 30th of October 2019 12:46:30 AM
Old 10-30-2019
If anyone (Akshay when back from vacation?) can improve this, please suggest something:

Code:
<?php

function updateDB($os, $section, $query, $text, $raw = '')
{
    global $vbulletin;
    $dateline = time();
    $string = substr($text, 0, 20);
    $snippet = trim(preg_replace('/\s+/', ' ', $string));
    $token = $os . '_' . $section . '_' . $query;
    if (strlen($token) >= 1) {
        $sql = 'INSERT INTO neo_man_page_entry
        (os, section, query, text, formatted,  token, strlen, dateline )
    VALUES
        ("' .
        htmlentities($os, ENT_QUOTES) . '","' .
        htmlentities($section, ENT_QUOTES) . '","' .
        htmlentities($query, ENT_QUOTES) . '","' .
        htmlentities($text, ENT_QUOTES) . '","' .
        htmlentities($raw, ENT_QUOTES) . '","' .
        htmlentities($token, ENT_QUOTES) . '",' .
        strlen($raw) . ',' .
            $dateline . ')
    ON DUPLICATE KEY UPDATE
        dateline = ' . $dateline . ',hits = hits +1';
        $status = $vbulletin->db->query_write($sql);
        return $status;

    } else {
        $file = '/var/log/apache2/debug/neo_update_mandb_entry_error.log';
        $uid = $vbulletin->userinfo['userid'];
        $text = $raw = "unknown";
        error_log(date(DATE_RFC822) . " UID " . $uid . ' token ' . $token . ' len ' . strlen($text) . ' snip ' . $snippet . "\n", 3, $file);
        return -1;
    }

}


and:


Code:
mysql> describe neo_man_page_entry;
+-----------+------------------+------+-----+---------+----------------+
| Field     | Type             | Null | Key | Default | Extra          |
+-----------+------------------+------+-----+---------+----------------+
| manid     | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| token     | varchar(120)     | NO   | UNI | NULL    |                |
| dateline  | int(11) unsigned | NO   |     | NULL    |                |
| os        | varchar(16)      | NO   | MUL | NULL    |                |
| section   | varchar(8)       | NO   |     | NULL    |                |
| query     | varchar(64)      | NO   | MUL | NULL    |                |
| text      | mediumtext       | NO   | MUL | NULL    |                |
| formatted | mediumtext       | NO   |     | NULL    |                |
| strlen    | int(10) unsigned | NO   |     | 0       |                |
| hits      | int(10) unsigned | NO   |     | 1       |                |
+-----------+------------------+------+-----+---------+----------------+
10 rows in set (0.00 sec)

 

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Man pages

Hello , I just installed openssh in my system . I actually tried to man sshd but it says no entry , though there is a man directory in the installation which have the man pages for sshd . Can anyone tell me how should i install these man pages . DP (2 Replies)
Discussion started by: DPAI
2 Replies

2. UNIX for Dummies Questions & Answers

man pages

Hi, I've written now a man pages, but I don't knwo how to get 'man' to view them. Where have I to put this files, which directories are allowed?? THX Bensky (3 Replies)
Discussion started by: bensky
3 Replies

3. Programming

Man pages for C API for MySql

Hi, I am on Ubuntu 9.04 tweaking some programs demanding MySql queries. I got the program working by installing following package: sudo apt-get install libmysqlclient-dev and using proper include and library folder However I was unable to access any man pages for these C api's (Strangely... (1 Reply)
Discussion started by: dheerajsuthar
1 Replies

4. HP-UX

Looking for some man pages.

Can anyone supply me with the man pages for: omnidatalist omnibarlist omnisap.exe I prefer the source man pages in nroff format. A clue about the software bundles which supply these man pages is fine as well. OS: HP-UX TIA (11 Replies)
Discussion started by: sb008
11 Replies
vacation(1)						      General Commands Manual						       vacation(1)

NAME
vacation - Informs senders of mail that recipient is absent SYNOPSIS
vacation -I The vacation command returns a message to the sender of a mail message, saying that the recipient is on vacation or otherwise absent. OPTIONS
Initializes the $HOME/.vacation.pag and $HOME/.vacation.dir files. Execute this option before you modify your $HOME/.forward file. DESCRIPTION
The vacation command accepts standard input and attempts to send a vacation message to the user specified in that input, which should be a mail message. The vacation command is usually invoked in your $HOME/.forward file, which is used to forward your mail to another username. When you want vacation messages to be sent to users who send you mail, enter the following in your $HOME/.forward file: user, "|vacation user" Replace user by your username. This allows mail sent to you to be both received by you and piped to the vacation command; vacation reads the mail message, determines the sender, and sends a reply. The sender receives a vacation message, and the original mail is waiting in your mailbox when you return. When vacation is invoked without the -I option, as in the file, it reads the first line from the standard input for a From line to deter- mine the sender. If this is not present, an error message is produced. (All properly formatted incoming mail should include a From line.) No vacation message is sent if the From header line indicates that the message is from Postmaster; from MAILER-DAEMON; if the initial From line includes the string -REQUEST@; or if a Precedence: bulk or Precedence: junk line is included in the header. You must initialize vacation for your username by issuing the command vacation -I before you can use the vacation command. The vacation command expects a $HOME/.vacation.msg file containing a message to be sent back to each sender. The file should be an entire message, including any desired headers, such as From or Subject. This message will be sent only once a week to each unique message sender. (If this file does not exist, vacation uses /usr/share/lib/vacation.def, a system-wide default vacation message, if it exists.) The names of people who have sent you messages are kept in the files $HOME/.vacation.pag and $HOME/.vacation.dir. These files are created when you initialize vacation for your username with vacation -I. EXAMPLES
If your username is myra and you want to send a message once a week to each person who has sent you mail, initialize vacation by entering: vacation -I Next, add the following line to your $HOME/.forward file (create this file if it does not exist): myra, "|vacation myra" If you want to send a vacation message other than the system default message in /usr/share/lib/vacation.def, create the file in your home directory and enter the message in it. For example: From: myra@k.table (Myra Louise Minter) Subject: I am on vacation. Delivered-By-the-Graces-Of: the Vacation program I am on vacation until October 1. If you have something urgent, please telephone Lucy or Sue. -- Myra FILES
System-wide default vacation message. Contains address to which mail is forwarded. Contains the names of people who have sent you mail while the vacation command was being used. Contains the names of people who have sent you mail while the vacation command was being used. Contains your personal vacation message. SEE ALSO
Commands: mail(1), mailx(1), sendmail(8) vacation(1)
All times are GMT -4. The time now is 02:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy