Всем привет, пользователи, администраторы, модераторы сайта allcity! Я создаю музыкальный сайт, и мне вот что интересно! Я не могу сделать следующее, подскажите Мне нужно, чтобы загружаемая картинка для "скриншот", показывалась вместо белого фона... И как задать стандарт, чтобы если не загружать скриншот, автоматически была картинка NOCOVER взаместо белого фона.... Голову ломал ломал решил к вам обратиться!!!
Conditional blocks allow to output (to process) or not to output (not to process) some particular fragment of a template depending on various conditions. These conditions are applied to the values of special template variables (such as $GROUP_ID$). A conditional block is opened by the '<?if()?>' operator and closed by the '<?endif?>' operator. Several conditional blocks can be nested.
Conditional operators have the following syntax: <?if($VARNAME$)?>true_code<?else?>false_code<?endif?>
* $VARNAME$ - name of a special variable, the value of which will be compared with a condition. * true_code – HTML code to be displayed if a specified condition is true (can be empty if only negative test is necessary). * false_code – HTML code to be displayed if a specified condition is false (can be absent together with '<?else?>' operator if only positive test is necessary).
Some examples: <?if($USER_LOGGED_IN$)?>Hello $USERNAME$<?endif?>
<?if(!$USER_LOGGED_IN$)?>You are just a GUEST<?endif?>
<?if($USER_LOGGED_IN$ and $USERNAME$='Andrew')?>Hello Andrew<?endif?>
<?if($MODULE_ID$='load' and $PAGE_ID$='category')?>Categories page<?else?>Other page<?endif?>
* = - full coincidence of the value with the operand (case sensitive string comparison); * ! - mismatch of the value with the operand (negation of case sensitive string comparison); * > - the value is numerically greater than the operand (numerical comparison of integer or fractional decimal numbers); * < - the value is numerically less than the operand (numerical comparison of integer or fractional decimal numbers); * % - integer remainder of the division of the value by the operand (see note **); * & - bitwise "AND" between the value and the operand (see note **);
* && (and) – logical AND; * || (or) – logical OR;
* substr($STRING$,pos,num) - getting of a substring of the string $STRING$, starting from the position pos, of the length num characters; * strpos($STRING$,'substring') - getting of a position of the substring substring in the string $STRING$;
*The variable's value is considered to be false (not true) if it is empty or equal to '0' (i.e. '4', 'Hello', '00' or '0.0' are considered to be true).
** For the operations '%' and '&' an operand can be specified either as one number or as two numbers separated by 'equals' character ('='). In the first case the result of the corresponding operation will be tested against non-zero value, i.e. '%2' means 'remainder of the division by 2 is not equal to zero'. Examples: You <?if($USER_LOGGED_IN$)?>have logged in as "$USERNAME$"<?else?>haven’t authorized yourself<?endif?>. It outputs (having substituted $USERNAME$ by its value) You have logged in as "$USERNAME$". if $USER_LOGGED_IN$ is true, otherwise You haven’t authorized yourself. <?if($USERNAME$='Hacker' || $USERNAME$='bad_boy' || substr($USERNAME$,0,4)='anti')?>No way, $USERNAME$!!!<?endif?> It outputs (having substituted $USERNAME$) by its value No way, $USERNAME$!!! if $USERNAME$ equals to 'Hacker' or 'bad_boy', or begins with 'anti'. <?if($POSTS$>50)?>***<?else?><?if($POSTS$>10.0)?>**<?else?>*<?endif?><?endif?> It outputs ' *** ', if $POSTS$ is greater than 50, ' ** ', if it is greater than 10 and less than or equal to 50, and ' * ', if it is less than or equal to 10. <?if($NUMBER$%2=1)?>odd<?else?>even<?endif?> It outputs whether the value of $NUMBER$ is even or odd.
Re: Вопрос по Скриншоту
Добавлено: 22 июл 2009, 17:42
Адреналин
А по русски???
Re: Вопрос по Скриншоту
Добавлено: 23 июл 2009, 02:15
Youzer
тебе нужно, чтобы винил накладывался поверх "скриншота"? тогда сохраняй винил с прозрачным фоном в GIF (или PNG. свои недостатки есть у обоих форматов), скриншот выводи бэкграундом, а винил через IMG SRC. если конечно со слоями заморачиваться не хочешь
Re: Вопрос по Скриншоту
Добавлено: 23 июл 2009, 21:44
Адреналин
Блииииин. кто нить зайдите ко мне на сайт, сделайте все как надо... Нифига я не понимаю в этих тегах
Re: Вопрос по Скриншоту
Добавлено: 24 июл 2009, 04:28
Youzer
по чужим сайтам не хожу. сделать и сам сможешь, вот схема:
<?if($IMG_URL1$)?> <div style="background:url($IMG_URL1$) left top no-repeat; width:300px; height:200px;"><img src="vinil.gif" border="0" /></div> <?else?> <div style="background:url(noimage.jpg) left top no-repeat; width:300px; height:200px;"><img src="vinil.gif" border="0" /></div> <?endif?>
"скриншот" загружается через IMG_URL1 и выводится бэкграундом. vinil.gif - в обоих случаях - путь к картинке с винилом noimage.jpg - путь к картинке, заменяющей скриншот, когда его нет размер скриншота строго 200х200