Форум программистов, компьютерный форум, киберфорум
WordPress
Войти
Регистрация
Восстановить пароль
Карта форума Темы раздела Блоги Сообщество Поиск Заказать работу  
 
0 / 0 / 0
Регистрация: 25.11.2013
Сообщений: 5
1

Вывести новость с главным фото - плагин userfrontend

19.03.2015, 19:45. Показов 439. Ответов 0
Метки нет (Все метки)

Author24 — интернет-сервис помощи студентам
смотрите я установил плагин userfrontend, и у меня стоит задача добавить строку где загрузить фото статьи и это фото должна стоять на главном и внутри поста остальное !покопался на php сломал все что можно но не смог сделать!проблема в том что когда добавляешь новость все подряд выходит без главного фото и.т.д

PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php
/*
Plugin Name: WP User Frontend
Plugin URI: http://tareq.wedevs.com/2011/01/new-plugin-wordpress-user-frontend/
Description: Post, Edit, Delete posts and edit profile without coming to backend
Author: Tareq Hasan
Version: 1.3.2
Author URI: http://tareq.weDevs.com
*/
 
if ( !class_exists( 'WeDevs_Settings_API' ) ) {
    require_once dirname( __FILE__ ) . '/lib/class.settings-api.php';
}
 
require_once 'wpuf-functions.php';
require_once 'admin/settings-options.php';
require_once 'admin/form-builder.php';
 
if ( is_admin() ) {
    require_once 'admin/settings.php';
    require_once 'admin/custom-fields.php';
    require_once 'admin/taxonomy.php';
    require_once 'admin/subscription.php';
    require_once 'admin/transaction.php';
}
 
require_once 'wpuf-dashboard.php';
require_once 'wpuf-add-post.php';
require_once 'wpuf-edit-post.php';
require_once 'wpuf-editprofile.php';
require_once 'wpuf-edit-user.php';
require_once 'wpuf-ajax.php';
 
require_once 'wpuf-subscription.php';
require_once 'wpuf-payment.php';
require_once 'lib/attachment.php';
require_once 'lib/gateway/paypal.php';
 
class WPUF_Main {
 
    function __construct() {
        register_activation_hook( __FILE__, array($this, 'install') );
        register_deactivation_hook( __FILE__, array($this, 'uninstall') );
 
        add_action( 'admin_init', array($this, 'block_admin_access') );
 
        add_action( 'init', array($this, 'load_textdomain') );
        add_action( 'wp_enqueue_scripts', array($this, 'enqueue_scripts') );
    }
 
    /**
     * Create tables on plugin activation
     *
     * @global object $wpdb
     */
    function install() {
        global $wpdb;
 
        flush_rewrite_rules( false );
 
        $sql_custom = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wpuf_customfields (
         `id` int(11) NOT NULL AUTO_INCREMENT,
         `field` varchar(30) NOT NULL,
         `type` varchar(20) NOT NULL,
         `values` text NOT NULL,
         `label` varchar(200) NOT NULL,
         `desc` varchar(200) NOT NULL,
         `required` varchar(5) NOT NULL,
         `region` varchar(20) NOT NULL DEFAULT 'top',
         `order` int(1) NOT NULL,
         PRIMARY KEY (`id`)
        ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
 
        $sql_subscription = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wpuf_subscription (
        `id` mediumint(9) NOT NULL AUTO_INCREMENT,
        `name` varchar(255) NOT NULL,
        `description` text NOT NULL,
        `count` int(5) DEFAULT '0',
        `duration` int(5) NOT NULL DEFAULT '0',
        `cost` float NOT NULL DEFAULT '0',
        `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
        PRIMARY KEY (`id`)
        ) ENGINE=MyISAM  DEFAULT CHARSET=utf8;";
 
        $sql_transaction = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wpuf_transaction (
        `id` mediumint(9) NOT NULL AUTO_INCREMENT,
        `user_id` bigint(20) DEFAULT NULL,
        `status` varchar(255) NOT NULL DEFAULT 'pending_payment',
        `cost` varchar(255) DEFAULT '',
        `post_id` bigint(20) DEFAULT NULL,
        `pack_id` bigint(20) DEFAULT NULL,
        `payer_first_name` longtext,
        `payer_last_name` longtext,
        `payer_email` longtext,
        `payment_type` longtext,
        `payer_address` longtext,
        `transaction_id` longtext,
        `created` datetime NOT NULL,
        PRIMARY KEY (`id`)
        ) ENGINE=MyISAM  DEFAULT CHARSET=utf8;";
 
        $wpdb->query( $sql_custom );
        $wpdb->query( $sql_subscription );
        $wpdb->query( $sql_transaction );
    }
 
    function uninstall() {
 
    }
 
    /**
     * Enqueues Styles and Scripts when the shortcodes are used only
     *
     * @uses has_shortcode()
     * @since 0.2
     */
    function enqueue_scripts() {
        $path = plugins_url('', __FILE__ );
 
        //for multisite upload limit filter
        if ( is_multisite() ) {
            require_once ABSPATH . '/wp-admin/includes/ms.php';
        }
 
        require_once ABSPATH . '/wp-admin/includes/template.php';
 
        wp_enqueue_style( 'wpuf', $path . '/css/wpuf.css' );
 
        if ( wpuf_has_shortcode( 'wpuf_addpost' ) || wpuf_has_shortcode( 'wpuf_edit' ) ) {
            wp_enqueue_script( 'plupload-handlers' );
        }
 
        wp_enqueue_script( 'wpuf', $path . '/js/wpuf.js', array('jquery') );
 
        $posting_msg = wpuf_get_option( 'updating_label', 'wpuf_labels' );
        $feat_img_enabled = ( wpuf_get_option( 'enable_featured_image', 'wpuf_frontend_posting' ) == 'yes') ? true : false;
        wp_localize_script( 'wpuf', 'wpuf', array(
            'ajaxurl' => admin_url( 'admin-ajax.php' ),
            'postingMsg' => $posting_msg,
            'confirmMsg' => __( 'Are you sure?', 'wpuf' ),
            'nonce' => wp_create_nonce( 'wpuf_nonce' ),
            'featEnabled' => $feat_img_enabled,
            'plupload' => array(
                'runtimes' => 'html5,silverlight,flash,html4',
                'browse_button' => 'wpuf-ft-upload-pickfiles',
                'container' => 'wpuf-ft-upload-container',
                'file_data_name' => 'wpuf_featured_img',
                'max_file_size' => wp_max_upload_size() . 'b',
                'url' => admin_url( 'admin-ajax.php' ) . '?action=wpuf_featured_img&nonce=' . wp_create_nonce( 'wpuf_featured_img' ),
                'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ),
                'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
                'filters' => array(array('title' => __( 'Allowed Files' ), 'extensions' => '*')),
                'multipart' => true,
                'urlstream_upload' => true,
            )
        ) );
    }
 
    /**
     * Block user access to admin panel for specific roles
     *
     * @global string $pagenow
     */
    function block_admin_access() {
        global $pagenow;
 
        // bail out if we are from WP Cli
        if ( defined( 'WP_CLI' ) ) {
            return;
        }
 
        $access_level = wpuf_get_option( 'admin_access', 'wpuf_others', 'read' );
        $valid_pages = array('admin-ajax.php', 'async-upload.php', 'media-upload.php');
 
        if ( !current_user_can( $access_level ) && !in_array( $pagenow, $valid_pages ) ) {
            wp_die( __( 'Access Denied. Your site administrator has blocked your access to the WordPress back-office.', 'wpuf' ) );
        }
    }
 
    /**
     * Load the translation file for current language.
     *
     * @since version 0.7
     * @author Tareq Hasan
     */
    function load_textdomain() {
        $locale = apply_filters( 'wpuf_locale', get_locale() );
        $mofile = dirname( __FILE__ ) . "/languages/wpuf-$locale.mo";
 
        if ( file_exists( $mofile ) ) {
            load_textdomain( 'wpuf', $mofile );
        }
    }
 
    /**
     * The main logging function
     *
     * @uses error_log
     * @param string $type type of the error. e.g: debug, error, info
     * @param string $msg
     */
    public static function log( $type = '', $msg = '' ) {
        if ( WP_DEBUG == true ) {
            $msg = sprintf( "[%s][%s] %s\n", date( 'd.m.Y h:i:s' ), $type, $msg );
            error_log( $msg, 3, dirname( __FILE__ ) . '/log.txt' );
        }
    }
 
}
 
$wpuf = new WPUF_Main();
0
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
19.03.2015, 19:45
Ответы с готовыми решениями:

Как вывести короткую новость?
Установил новую тему Wordpress все посты стали выводиться полностью на сайте, помогите, кто в теме,...

Плагин смены фото и текста
Приветствую. Нужно разместить в боковой колонке типа отзывов. Должна присутствовать фотка и текст....

Ищу плагин для больших фото
Всем ку ) Пишу галерею для больших фотографий, все интернеты перелопатил в поисках конкретного...

Используя id вывести нужную новость
Привет, в общем дело в следующем, у меня есть вот такой код вывода новостей на страницу в панель...

0
19.03.2015, 19:45
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
19.03.2015, 19:45
Помогаю со студенческими работами здесь

Не получается вывести полную новость методом GET
вот сам цикл новостей из бд &lt;?php while($rowarr = mysql_fetch_array($querymat)){ ...

Как можно вывести в цикле новость
Доброго времени суток! Сейчас поставил вывод сотрудников таким образом: $db =...

короткая "новость" -> длинная новость на WP
Доброго дня! Как можно на главной вывести &quot;короткую новость&quot; на главной, длинную выводить - по...

Вывести фото из БД
Работаю над программкой. public int User_id; public void...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
1
Ответ Создать тему
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2024, CyberForum.ru