Example #1
0
    function outputRSS()
    {
        global $wpdb, $cformsSettings, $plugindir;
        $temp = get_query_var('cformsRSS');
        if ($temp != '') {
            $cformsRSS = explode('$#$', $temp);
            $no = $cformsRSS[0];
            $key = $cformsRSS[1];
            $all = $no == '-1' && $cformsSettings['global']['cforms_rssall'] && $cformsSettings['global']['cforms_rsskeyall'] == $key;
            $single = $no != '-1' && $cformsSettings['form' . $no]['cforms' . $no . '_rss'] && $key != '' && $cformsSettings['form' . $no]['cforms' . $no . '_rsskey'] == $key;
            if ($all || $single) {
                ### add opt. form content
                $WHERE = '';
                if ($all) {
                    $rsscount = $cformsSettings['global']['cforms_rssall_count'] > 0 ? $cformsSettings['global']['cforms_rssall_count'] : 5;
                } else {
                    if ($single) {
                        $WHERE = "WHERE form_id = '" . $no . "'";
                        $rsscount = $cformsSettings['form' . $no]['cforms' . $no . '_rss_count'] > 0 ? $cformsSettings['form' . $no]['cforms' . $no . '_rss_count'] : 5;
                    }
                }
                $entries = $wpdb->get_results("SELECT * FROM {$wpdb->cformssubmissions} {$WHERE} ORDER BY sub_date DESC LIMIT 0," . $rsscount);
                $content = '';
                if (count($entries) > 0) {
                    foreach ($entries as $entry) {
                        $f = $cformsSettings['form' . $entry->form_id]['cforms' . $entry->form_id . '_rss_fields'];
                        $date = mysql2date(get_option('date_format'), $entry->sub_date);
                        $time = mysql2date(get_option('time_format'), $entry->sub_date);
                        $title = '[' . $entry->id . '] ' . $entry->email;
                        $description = '<![CDATA[ <div style="margin:8px 0;"><span style="font-size:150%; color:#aaa;font-weight:bold;">#' . $entry->id . '</span> ' . "{$date}&nbsp;<strong>{$time}</strong>" . ($single ? '' : ' &nbsp;<strong>"' . $cformsSettings['form' . $entry->form_id]['cforms' . $entry->form_id . '_fname'] . '"</strong>:') . '</div>';
                        $data = $wpdb->get_results("SELECT * FROM {$wpdb->cformsdata} WHERE sub_id='{$entry->id}'");
                        if (is_array($f) && array_count_values($f) > 0) {
                            foreach ($data as $e) {
                                if (array_search($e->field_name, $f) !== false) {
                                    $description .= '<div style="width:100%; clear:left;"><div style="background:#F8FAFC;width:49%; float:left; text-align:right;margin-right:1%;">' . $e->field_name . ':</div><div style="width:50%; float:left;">' . $e->field_val . '</div></div>';
                                }
                            }
                        }
                        $description .= '<div style="margin:8px 0;"><a href="' . $entrylink . '">' . __('View details', 'cforms') . '</a></div> ]]>';
                        $entrylink = get_cf_siteurl() . '/wp-admin/admin.php?page=' . $plugindir . '/cforms-database.php&amp;d-id=' . $entry->id . '#entry' . $entry->id;
                        $content .= "\t" . '<item>' . "\n" . "\t\t" . '<title>' . $title . '</title>' . "\n" . "\t\t" . '<description>' . $description . '</description>' . "\n" . "\t\t" . '<link>' . $entrylink . '</link>' . "\n" . "\t\t" . '<guid isPermaLink="false">' . $entrylink . '</guid>' . "\n" . "\t\t" . '<pubDate>' . mysql2date('D, d M Y H:i:s +0000', $entry->sub_date, false) . '</pubDate>' . "\n" . "\t" . '</item>' . "\n";
                    }
                } else {
                    $content = '<item><title>' . __('No entries yet', 'cforms') . '</title><description>' . __('You might want to check back in a little while...', 'cforms') . '</description>' . '<link></link><guid isPermaLink="false"></guid><pubDate>' . gmdate('D, d M Y H:i:s +0000', current_time('timestamp')) . '</pubDate></item>';
                }
                header('Content-Type: text/xml; charset=' . get_option('blog_charset'));
                echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
                ?>

<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title><?php 
                if ($single) {
                    echo __('New submissions for >>', 'cforms') . ' ' . stripslashes($cformsSettings['form' . $no]['cforms' . $no . '_fname']);
                } else {
                    _e('All new form submissions', 'cforms');
                }
                ?>
</title>
	<atom:link href="<?php 
                echo get_cf_siteurl() . '?cformsRSS=' . $no . urlencode('$#$') . $cformsSettings['form' . $no]['cforms' . $no . '_rsskey'];
                ?>
" rel="self" type="application/rss+xml" />
	<link><?php 
                echo get_cf_siteurl();
                ?>
</link>
	<description><?php 
                _e('This RSS feed provides you with the most recent form submissions.', 'cforms');
                ?>
</description>
	<pubDate><?php 
                echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false);
                ?>
</pubDate>
	<language><?php 
                echo get_option('rss_language');
                ?>
</language>
<?php 
                echo $content;
                ?>
</channel>
</rss>
<?php 
                exit;
            }
        }
    }
Example #2
0
function get_cf_plugindir()
{
    /*
    	$cr = defined('PLUGINDIR') ? get_cf_siteurl() .'/'. PLUGINDIR . '/' : get_cf_siteurl() . '/wp-content/plugins/';
    	$cr = defined('WP_CONTENT_URL') ? WP_CONTENT_URL.'/plugins/' : $cr;
    	$cr = defined('WP_PLUGIN_URL') ? WP_PLUGIN_URL .'/' : $cr;
    */
    if (!function_exists('is_ssl')) {
        function is_ssl()
        {
            if (isset($_SERVER['HTTPS'])) {
                if ('on' == strtolower($_SERVER['HTTPS'])) {
                    return true;
                }
                if ('1' == $_SERVER['HTTPS']) {
                    return true;
                }
            } elseif (isset($_SERVER['SERVER_PORT']) && '443' == $_SERVER['SERVER_PORT']) {
                return true;
            }
            return false;
        }
    }
    if (version_compare(get_bloginfo('version'), '3.0', '<') && is_ssl()) {
        $wp_content_url = str_replace('http://', 'https://', get_cf_siteurl());
    } else {
        $wp_content_url = get_cf_siteurl();
    }
    $wp_content_url .= '/wp-content';
    $wp_content_dir = ABSPATH . 'wp-content';
    $wp_plugin_url = $wp_content_url . '/plugins';
    $wp_plugin_dir = $wp_content_dir . '/plugins';
    $wpmu_plugin_url = $wp_content_url . '/mu-plugins';
    $wpmu_plugin_dir = $wp_content_dir . '/mu-plugins';
    return rtrim(plugin_dir_url(__FILE__), '/');
}
					<td class="obL" style="padding-top:8px; vertical-align:top;"><label for="cforms_rsskey"><strong><?php 
        _e('RSS Feed Security Key', 'cforms');
        ?>
<br /><br /></strong></label></td>
					<td class="obR">
						<input name="cforms_rsskeyall" id="cforms_rsskey" value="<?php 
        echo $cformsSettings['global']['cforms_rsskeyall'];
        ?>
" />
						<input type="submit" name="cforms_rsskeysnew" id="cforms_rsskeysnew" value="<?php 
        _e('Reset RSS Key', 'cforms');
        ?>
" class="allbuttons"  onclick="javascript:document.mainform.action='#tracking';"/>
						<br /><?php 
        _e('The complete RSS URL &raquo;', 'cforms');
        echo '<br />' . get_cf_siteurl() . '?cformsRSS=' . urlencode('-1$#$') . $cformsSettings['global']['cforms_rsskeyall'];
        ?>
					</td>
				</tr>
				<?php 
    }
    ?>

				</table>
			</div>
		</fieldset>

	    <div class="cf_actions" id="cf_actions" style="display:none;">
			<input id="cfbar-showinfo" class="allbuttons addbutton" type="submit" name="showinfo" value=""/>
			<input id="cfbar-deleteall" class="jqModalDelAll allbuttons deleteall" type="button" name="deleteallbutton" value=""/>
			<input id="deletetables" class="allbuttons deleteall" type="submit" name="deletetables" value=""/>
Example #4
0
					<td class="obR">
						<input name="cforms_rsskey" id="cforms_rsskey" value="<?php 
    echo $cformsSettings['form' . $no]['cforms' . $no . '_rsskey'];
    ?>
" />
						<input type="submit" name="cforms_rsskeysnew" id="cforms_rsskeysnew" value="<?php 
    _e('Reset RSS Key', 'cforms');
    ?>
" class="allbuttons"  onclick="javascript:document.mainform.action='#anchoremail';"/>
                    </td>
				</tr>
				<tr class="ob">
					<td class="obL"></td>
					<td class="obR"><?php 
    _e('The complete RSS URL &raquo;', 'cforms');
    echo '<br />' . get_cf_siteurl() . '?cformsRSS=' . $no . urlencode('$#$') . $cformsSettings['form' . $no]['cforms' . $no . '_rsskey'];
    ?>
</td>
				</tr>
				<?php 
}
?>
				</table>
			</div>
		</fieldset>


		<fieldset class="cformsoptions" id="emailoptions">
			<div class="cflegend op-closed" id="p3" title="<?php 
_e('Expand/Collapse', 'cforms');
?>
Example #5
0
<?php

global $wpdb, $cformsSettings;
$cformsSettings = (array) $cformsSettings;
### new global settings container
### a few basic things, always reset during (re)activation
$cformsSettings['global']['plugindir'] = basename(dirname(__FILE__));
$cformsSettings['global']['cforms_root'] = get_cf_plugindir();
// . $cformsSettings['global']['plugindir'];
$cformsSettings['global']['tinyURI'] = get_cf_siteurl() . '/wp-includes/js/tinymce';
$cformsSettings['global']['cforms_root_dir'] = dirname(__FILE__);
$cformsSettings['global']['cforms_IIS'] = strpos(dirname(__FILE__), '\\') !== false ? '\\' : '/';
$cformsSettings['global']['v'] = $localversion;
### Common HTML message information
$cformsSettings['global']['cforms_style_doctype'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
unset($cformsSettings['global']['cforms_style']);
$cformsSettings['global']['cforms_style']['body'] = 'style="margin:0; padding:0; font-family: Verdana, Arial; font-size: 13px; color:#555;"';
$cformsSettings['global']['cforms_style']['meta'] = 'style="font-size: 90%; margin:0; background:#aaaaaa; padding:1em 2em 1em 0.6em; color:#555555; text-shadow:0 1px 0 #c5c5c5; border-bottom:1px solid #9d9d9d;"';
$cformsSettings['global']['cforms_style']['admin'] = 'style="background:#f0f0f0; border-top:1px solid #777; box-shadow:0 -2px 2px #999; -webkit-box-shadow:0 -2px 2px #999;"';
$cformsSettings['global']['cforms_style']['title'] = 'style="font-size: 90%; margin:0; background:#fcfcfc; padding:1em 2em 1em 0.6em; color:#888888; display:inline-block;"';
$cformsSettings['global']['cforms_style']['table'] = 'style="width:auto; margin: 0.2em 2em 2em; font-size: 100%;"';
$cformsSettings['global']['cforms_style']['fs'] = 'style="color:#555; padding:1em 0 0.4em; font-size: 110%; font-weight:bold; text-shadow:0 1px 0 #fff;"';
$cformsSettings['global']['cforms_style']['key_td'] = 'style="padding: 0.3em 1em; border-bottom:1px dotted #ddd; padding-right:2em; color:#888; width:1%;"';
$cformsSettings['global']['cforms_style']['val_td'] = 'style="padding: 0.3em 1em; border-bottom:1px dotted #ddd; padding-left:0; color:#333;"';
$cformsSettings['global']['cforms_style']['cforms'] = 'style="display:block; padding:1em 0.6em; margin-top:1em; background:#f7f7f7; color:#777; font-size:90%; text-align:right; font-family:Tahoma,Arial;"';
$cformsSettings['global']['cforms_style']['autoconf'] = 'style="padding:1em 1em 0; background:#f0f0f0; color:#333;"';
$cformsSettings['global']['cforms_style']['dear'] = 'style="margin:0.5em 30px; font-weight:bold; margin-bottom:1.2em;"';
$cformsSettings['global']['cforms_style']['confp'] = 'style="margin:0.5em 30px;"';
$cformsSettings['global']['cforms_style']['confirmationmsg'] = 'style="margin:4em 30px 0; padding-bottom:1em; font-size:80%; color:#aaa; font-family:Tahoma,Arial;"';
### check for upgrade pre-9.0 to 9.0
if (check_update()) {