Форум программистов, компьютерный форум, киберфорум
PHP для начинающих
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.75/4: Рейтинг темы: голосов - 4, средняя оценка - 4.75
0 / 0 / 0
Регистрация: 03.10.2015
Сообщений: 4

Добавить в код еще одну зону для фотки

03.10.2015, 07:52. Показов 721. Ответов 1
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
привет!

есть код, Результат его вот здесь (внизу на черном фоне "наша команда" ) www.paskales.com


сейчас можно внести всего 4 блока фото и описание, я хочу сделать больше, допустим 10 блоков. Но как зарегистрировать новые? Задумка такая, чтобы они либо крутились слайдером с медленной задержкой, причем последующая фотка чтобы выбиралась рандомно. Возможно это сделать?.. предпринимала пару самостоятельных попыток, при которых весь сайт падает)

(сейчас там используется ДЕМО)
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<?php
/**
 * The template for displaying the Featured Content
 *
 * @package Catch Themes
 * @subpackage Catch Adaptive
 * @since Catch Adaptive 0.1
 */
 
if ( ! defined( 'CATCHADAPTIVE_THEME_VERSION' ) ) {
    header( 'Status: 403 Forbidden' );
    header( 'HTTP/1.1 403 Forbidden' );
    exit();
}
 
 
if( !function_exists( 'catchadaptive_featured_content_display' ) ) :
/**
* Add Featured content.
*
* @uses action hook catchadaptive_before_content.
*
* @since Catch Adaptive 0.1
*/
function catchadaptive_featured_content_display() {
    //catchadaptive_flush_transients();
    
    global $post, $wp_query;
 
    // get data value from options
    $options        = catchadaptive_get_theme_options();
    $enablecontent  = $options['featured_content_option'];
    $contentselect  = $options['featured_content_type'];
    $sliderselect   = $options['featured_content_slider'];
    
    // Front page displays in Reading Settings
    $page_on_front  = get_option('page_on_front') ;
    $page_for_posts = get_option('page_for_posts'); 
 
 
    // Get Page ID outside Loop
    $page_id = $wp_query->get_queried_object_id();
    if ( $enablecontent == 'entire-site' || ( ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) && $enablecontent == 'homepage' ) ) {
        if( ( !$catchadaptive_featured_content = get_transient( 'catchadaptive_featured_content_display' ) ) ) {
            $layouts     = $options ['featured_content_layout'];
            $headline    = $options ['featured_content_headline'];
            $subheadline = $options ['featured_content_subheadline'];
    
            echo '<!-- refreshing cache -->';
 
            if ( !empty( $layouts ) ) {
                $classes = $layouts ;
            }
 
            if( $contentselect == 'demo-featured-content' ) {
                $classes        .= ' demo-featured-content' ;
                $headline       = __( 'Featured Content', 'catchadaptive' );
                $subheadline    = __( '<p  style="font-size:24px;">НАША КОМАНДА</p>', 'catchadaptive' );
            } 
            elseif ( $contentselect == 'featured-page-content' ) {
                $classes .= ' featured-page-content' ;
            }
 
            if ( '1' == $options ['featured_content_position'] ) {
                $classes .= ' border-top' ;
            }
 
            $catchadaptive_featured_content ='
                <section id="featured-content" class="' . $classes . '">
                    <div class="wrapper">';
                        if ( !empty( $headline ) || !empty( $subheadline ) ) {
                            $catchadaptive_featured_content .='<div class="featured-heading-wrap">';
                                if ( !empty( $headline ) ) {
                                    $catchadaptive_featured_content .='<h1 id="featured-heading" class="entry-title">'.  $headline .'</h1>';
                                }
                                if ( !empty( $subheadline ) ) {
                                    $catchadaptive_featured_content .='<p>'. $subheadline .'</p>';
                                }
                            $catchadaptive_featured_content .='</div><!-- .featured-heading-wrap -->';
                        }
                        $catchadaptive_featured_content .='
                        <div class="featured-content-wrap">';
 
                            if ( $sliderselect ) {
                                $catchadaptive_featured_content .='
                                <!-- prev/next links -->
                                <div id="content-controls">
                                    <div id="content-prev"></div>
                                    <div id="content-next"></div>
                                </div>
                                <div class="cycle-slideshow" 
                                    data-cycle-log="false"
                                    data-cycle-pause-on-hover="true"
                                    data-cycle-swipe="true"
                                    data-cycle-auto-height=container
                                    data-cycle-slides=".featured_content_slider_wrap"
                                    data-cycle-fx="scrollHorz"
                                    data-cycle-prev="#content-prev"
                                    data-cycle-next="#content-next"
                                    >';
                             }
 
                            // Select content
                            if ( $contentselect == 'demo-featured-content'  && function_exists( 'catchadaptive_demo_content' ) ) {
                                $catchadaptive_featured_content .= catchadaptive_demo_content( $options );
                            }
                            elseif ( $contentselect == 'featured-page-content' && function_exists( 'catchadaptive_page_content' ) ) {
                                $catchadaptive_featured_content .= catchadaptive_page_content( $options );
                            }
 
                            if ( $sliderselect ) {
                                $catchadaptive_featured_content .='
                                </div><!-- .cycle-slideshow -->';
                            }
 
            $catchadaptive_featured_content .='
                        </div><!-- .featured-content-wrap -->
                    </div><!-- .wrapper -->
                </section><!-- #featured-content -->';
        set_transient( 'catchadaptive_featured_content', $catchadaptive_featured_content, 86940 );
        }
    echo $catchadaptive_featured_content;
    }
}
endif;
 
 
if ( ! function_exists( 'catchadaptive_featured_content_display_position' ) ) :
/**
 * Homepage Featured Content Position
 *
 * @action catchadaptive_content, catchadaptive_after_secondary
 * 
 * @since Catch Adaptive 0.1
 */
function catchadaptive_featured_content_display_position() {
    // Getting data from Theme Options
    $options        = catchadaptive_get_theme_options();
    
    if ( '1' != $options['featured_content_position'] ) { 
        add_action( 'catchadaptive_before_content', 'catchadaptive_featured_content_display', 60 );
    } else {
        add_action( 'catchadaptive_after_content', 'catchadaptive_featured_content_display', 40 );
    }
    
}
endif; // catchadaptive_featured_content_display_position
add_action( 'catchadaptive_before', 'catchadaptive_featured_content_display_position' );
 
 
if ( ! function_exists( 'catchadaptive_demo_content' ) ) :
/**
 * This function to display featured posts content
 *
 * @get the data value from customizer options
 *
 * @since Catch Adaptive 0.1
 *
 */
function catchadaptive_demo_content( $options ) {
    $catchadaptive_demo_content = '
    <div class="featured_content_slider_wrap">
        <article id="featured-post-1" class="post hentry post-demo">
            <figure class="featured-content-image">
                <img alt="' .  __( 'дизайнер', 'catchadaptive' ) . '" class="wp-post-image" src="http://storage8.static.itmages.ru/i/15/1001/h_1443719427_8523481_3f3c51c414.png" />
            </figure>
            <div class="entry-container">
                <header class="entry-header">
                    <h1 class="entry-title">
                        ' .  __( '<p  style=font-size:18px; >Кристина</p><p style=font-size:14px; align="left"  >Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat</p>', 'catchadaptive' ) . '
                    </h1>
                </header>
            </div><!-- .entry-container -->         
        </article>
 
        <article id="featured-post-2" class="post hentry post-demo">
            <figure class="featured-content-image">
                <img alt="' .  __( 'дизайнер', 'catchadaptive' ) . '" class="wp-post-image" src="http://storage3.static.itmages.ru/i/15/1001/h_1443722180_6633667_5cf9f9cbeb.png" />
            </figure>
            <div class="entry-container">
                <header class="entry-header">
                    <h1 class="entry-title">
                        ' .  __( '<p  style=font-size:18px; >Татьяна</p><p style=font-size:14px; align="left"  >Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat</p>', 'catchadaptive' ) . '
                    </h1>
                </header>
            </div><!-- .entry-container -->         
        </article>
        
        <article id="featured-post-3" class="post hentry post-demo">
            <figure class="featured-content-image">
                <img alt="' .  __( 'Vespa Scooter', 'catchadaptive' ) . '" class="wp-post-image" src="http://storage6.static.itmages.ru/i/15/1001/h_1443725961_5549250_70891f4edd.png" />
            </figure>
            <div class="entry-container">
                <header class="entry-header">
                    <h1 class="entry-title">
                        ' . __( '<p  style=font-size:18px; >Ольга</p><p style=font-size:14px; align="left"  >Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat</p>', 'catchadaptive' ) . '
                    </h1>
                </header>
            </div><!-- .entry-container -->         
        </article>';
 
    if( 'layout-four' == $options ['featured_content_layout']) {
        $catchadaptive_demo_content .= '
        <article id="featured-post-4" class="post hentry post-demo">
            <figure class="featured-content-image">
                <img alt="' .  __( 'Dhulikhel', 'catchadaptive' ) . '" class="wp-post-image" src="http://storage4.static.itmages.ru/i/15/1001/h_1443725635_5365966_b25f4aeb1e.png" />
            </figure>
            <div class="entry-container">
                <header class="entry-header">
                    <h1 class="entry-title">
                        ' .  __( '<p  style=font-size:18px; >Анна</p><p style=font-size:14px; align="left"  >Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat</p>', 'catchadaptive' ) . '
                    </h1>
                </header>
            </div><!-- .entry-container -->         
        </article>';
    }
    $catchadaptive_demo_content .= '</div><!-- .featured_content_slider_wrap -->';
 
    return $catchadaptive_demo_content;
}
endif; // catchadaptive_demo_content
 
 
if ( ! function_exists( 'catchadaptive_page_content' ) ) :
/**
 * This function to display featured page content
 *
 * @param $options: catchadaptive_theme_options from customizer
 *
 * @since Catch Adaptive 0.1
 */
function catchadaptive_page_content( $options ) {
    global $post;
 
    $quantity       = $options['featured_content_number'];
    $show_content   = $options['featured_content_show'];
    
    $catchadaptive_page_content     = '';
 
    $number_of_page             = 0;        // for number of pages
 
    $page_list                  = array();  // list of valid pages ids
 
    if( 'layout-four' == $options ['featured_content_layout']) {
        $layouts = 4;
    }
    else{
        $layouts = 3;
    }
 
    //Get valid pages
    for( $i = 1; $i <= $quantity; $i++ ){
        if( isset ( $options['featured_content_page_' . $i] ) && $options['featured_content_page_' . $i] > 0 ){
            $number_of_page++;
 
            $page_list  =   array_merge( $page_list, array( $options['featured_content_page_' . $i] ) );
        }
 
    }
    if ( !empty( $page_list ) && $number_of_page > 0 ) {
        $get_featured_posts = new WP_Query( array(
                    'posts_per_page'        => $number_of_page,
                    'post__in'              => $page_list,
                    'orderby'               => 'post__in',
                    'post_type'             => 'page',
                ));
 
        $i=0; 
 
        $catchadaptive_page_content = '
        <div class="featured_content_slider_wrap">';
 
        while ( $get_featured_posts->have_posts()) : 
            $get_featured_posts->the_post(); 
 
            $i++;
            
            $title_attribute = the_title_attribute( array( 'before' => __( 'Permalink to:', 'catchadaptive' ), 'echo' => false ) );
            
            $excerpt = get_the_excerpt();
            
            $catchadaptive_page_content .= '
                <article id="featured-post-' . $i . '" class="post hentry featured-page-content">'; 
                if ( has_post_thumbnail() ) {
                    $catchadaptive_page_content .= '
                    <figure class="featured-homepage-image">
                        <a href="' . get_permalink() . '" title="' . the_title_attribute( array( 'before' => __( 'Permalink to:', 'catchadaptive' ), 'echo' => false ) ) . '">
                        '. get_the_post_thumbnail( $post->ID, 'catchadaptive-featured-content', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ), 'class' => 'pngfix' ) ) .'
                        </a>
                    </figure>';
                }
                else {
                    //Default value if there is no first image
                    $catchadaptive_image = '<img class="pngfix wp-post-image" src="'.get_template_directory_uri().'/images/gallery/no-featured-image-1680x720.jpg" >';
                    
                    //Get the first image in page, returns false if there is no image
                    $catchadaptive_first_image = catchadaptive_get_first_image( $post->ID, 'catchadaptive-featured-content', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ), 'class' => 'pngfix' ) );
 
                    //Set value of image as first image if there is an image present in the page
                    if ( '' != $catchadaptive_first_image ) {
                        $catchadaptive_image =  $catchadaptive_first_image;
                    }
 
                    $catchadaptive_page_content .= '<a title="' . the_title_attribute( array( 'before' => __( 'Permalink to:', 'catchadaptive' ), 'echo' => false ) ) . '" href="' . get_permalink() . '">
                        '. $catchadaptive_image .'
                    </a>';
                }
 
                if ( '1' == $options['featured_content_enable_title'] || 'hide-content' != $show_content ) {
                $catchadaptive_page_content .= '
                    <div class="entry-container">';
                    if ( '1' == $options['featured_content_enable_title'] ) {       
                            $catchadaptive_page_content .= the_title( '<header class="entry-header"><h1 class="entry-title">','</h1></header>', false );
                    }
 
                    if ( 'excerpt' == $show_content ) {
                        $catchadaptive_page_content .= '<div class="entry-excerpt"><p>' . $excerpt . '</p></div><!-- .entry-excerpt -->';
                    }
                    elseif ( 'full-content' == $show_content ) { 
                        $content = apply_filters( 'the_content', get_the_content() );
                        $content = str_replace( ']]>', ']]&gt;', $content );
                        $catchadaptive_page_content .= '<div class="entry-content">' . $content . '</div><!-- .entry-content -->';
                    }
 
                    $catchadaptive_page_content .= '
                    </div><!-- .entry-container -->';
                }
                $catchadaptive_page_content .= '
                </article><!-- .featured-page-'. $i .' -->';
                
                if ( 0 == ( $i % $layouts ) && $i < $number_of_page ) {
                    //end and start featured_content_slider_wrap div based on logic
                    $catchadaptive_page_content .= '
                </div><!-- .featured_content_slider_wrap -->
                
                <div class="featured_content_slider_wrap">';
                }
        endwhile;
 
        wp_reset_query();
 
        $catchadaptive_page_content .= '</div><!-- .featured_content_slider_wrap -->';
    }       
    
    return $catchadaptive_page_content;
}
endif; // catchadaptive_page_content
0
IT_Exp
Эксперт
34794 / 4073 / 2104
Регистрация: 17.06.2006
Сообщений: 32,602
Блог
03.10.2015, 07:52
Ответы с готовыми решениями:

Добавить в if еще одну проверку
Я написал так : if(result&lt;0 || result&gt;2) { cout&lt;&lt;&quot;ДЕМОН НЕ ПОНИМАЕТ ТВОЙ ТРЕП...

Добавить еще одну картинку в header
Мне надо чтоб картинка pobedalogo.png или pobedalogo.gif отображалась поверх .logo но сайт упорно ее не видит. ни как отдельный тег, ни...

Необходимо к БД добавить еще одну таблицу
помогите пожалуста к этой базу данных необходимо добавить таблицу в которой бы отражалось количество наличного товара на определенныю дату

1
165 / 150 / 58
Регистрация: 15.06.2013
Сообщений: 1,107
03.10.2015, 12:53
Со слайдерами это вам в раздел JS
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
BasicMan
Эксперт
29316 / 5623 / 2384
Регистрация: 17.02.2009
Сообщений: 30,364
Блог
03.10.2015, 12:53
Помогаю со студенческими работами здесь

Добавить еще одну колонку в TStringGrid
Я абсолютно не знаю Delphi, а преподаватель требует на зачет исправить программу, написанную другим студентом, может кто поможет, нужно...

Как добавить еще одну матрицу
Создал матрицу и к ней нужно добавить еще одну матрицу и сравнить их через Equals (ToString)

Добавить еще одну таблицу в базу данных
как добавить еще одну таблицу в базу данных??

Как добавить в график еще одну функцию?
В полярных координатах нужно реализовать траекторию по 2 точкам, скорость, ускорение, радиус кривизны. Осталось добавить последнее. ...

Как в QwtPlotCurve добавить еще одну точку [qwt]
я читал мануал по qwt и не нашел метод, с помощью которого можно добавлять точки по нажатию кнопки в QwtPlotCurve. Неужели нужно все...


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

Или воспользуйтесь поиском по форуму:
2
Ответ Создать тему
Новые блоги и статьи
Кто-нибудь знает, где можно бесплатно получить настольный компьютер или ноутбук? США.
Programma_Boinc 26.12.2025
Нашел на реддите интересную статью под названием Anyone know where to get a free Desktop or Laptop? Ниже её машинный перевод. После долгих разбирательств я наконец-то вернула себе. . .
Thinkpad X220 Tablet — это лучший бюджетный ноутбук для учёбы, точка.
Programma_Boinc 23.12.2025
Рецензия / Мнение/ Перевод Нашел на реддите интересную статью под названием The Thinkpad X220 Tablet is the best budget school laptop period . Ниже её машинный перевод. Thinkpad X220 Tablet —. . .
PhpStorm 2025.3: WSL Terminal всегда стартует в ~
and_y87 14.12.2025
PhpStorm 2025. 3: WSL Terminal всегда стартует в ~ (home), игнорируя директорию проекта Симптом: После обновления до PhpStorm 2025. 3 встроенный терминал WSL открывается в домашней директории. . .
Как объединить две одинаковые БД Access с разными данными
VikBal 11.12.2025
Помогите пожалуйста !! Как объединить 2 одинаковые БД Access с разными данными.
Новый ноутбук
volvo 07.12.2025
Всем привет. По скидке в "черную пятницу" взял себе новый ноутбук Lenovo ThinkBook 16 G7 на Амазоне: Ryzen 5 7533HS 64 Gb DDR5 1Tb NVMe 16" Full HD Display Win11 Pro
Музыка, написанная Искусственным Интеллектом
volvo 04.12.2025
Всем привет. Некоторое время назад меня заинтересовало, что уже умеет ИИ в плане написания музыки для песен, и, собственно, исполнения этих самых песен. Стихов у нас много, уже вышли 4 книги, еще 3. . .
От async/await к виртуальным потокам в Python
IndentationError 23.11.2025
Армин Ронахер поставил под сомнение async/ await. Создатель Flask заявляет: цветные функции - провал, виртуальные потоки - решение. Не threading-динозавры, а новое поколение лёгких потоков. Откат?. . .
Поиск "дружественных имён" СОМ портов
Argus19 22.11.2025
Поиск "дружественных имён" СОМ портов На странице: https:/ / norseev. ru/ 2018/ 01/ 04/ comportlist_windows/ нашёл схожую тему. Там приведён код на С++, который показывает только имена СОМ портов, типа,. . .
Сколько Государство потратило денег на меня, обеспечивая инсулином.
Programma_Boinc 20.11.2025
Сколько Государство потратило денег на меня, обеспечивая инсулином. Вот решила сделать интересный приблизительный подсчет, сколько государство потратило на меня денег на покупку инсулинов. . . .
Ломающие изменения в C#.NStar Alpha
Etyuhibosecyu 20.11.2025
Уже можно не только тестировать, но и пользоваться C#. NStar - писать оконные приложения, содержащие надписи, кнопки, текстовые поля и даже изображения, например, моя игра "Три в ряд" написана на этом. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2025, CyberForum.ru