Changeset 1789
- Timestamp:
- Feb 8, 2007, 2:31:05 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r1786 r1789 528 528 // inserts all found categories 529 529 $query_begin = ' 530 531 532 530 INSERT INTO '.$table_name.' 531 ('.implode(',', $dbfields).') 532 VALUES'; 533 533 534 534 $first = true; 535 $query_value = array(); 536 $query_value_index = 0; 535 $query_value = ''; 537 536 538 537 foreach ($datas as $insert) 539 538 { 540 $query_value[$query_value_index] .= '541 ';542 539 if ($first) 543 540 { 544 541 $first = false; 545 if (strlen($query_value[$query_value_index]) > 6)546 {547 $query_value[$query_value_index] .= ',';548 }549 542 } 550 543 else 551 544 { 552 if (strlen($query_value [$query_value_index]) >= $conf['max_allowed_packet'])545 if (strlen($query_value) >= $conf['max_allowed_packet']) 553 546 { 554 $query_value_index ++; 555 $query_value[$query_value_index] .= ' 556 '; 557 $first = true; 547 pwg_query( $query_begin.$query_value ); 548 $query_value = ''; 558 549 } 559 550 else 560 551 { 561 $query_value [$query_value_index].= ',';552 $query_value .= ','; 562 553 } 563 554 } 564 $query_value[$query_value_index] .= '('; 555 556 $query_value .= ' 557 ('; 558 565 559 foreach ($dbfields as $field_id => $dbfield) 566 560 { 567 561 if ($field_id > 0) 568 562 { 569 $query_value [$query_value_index].= ',';563 $query_value .= ','; 570 564 } 571 565 572 566 if (!isset($insert[$dbfield]) or $insert[$dbfield] === '') 573 567 { 574 $query_value [$query_value_index].= 'NULL';568 $query_value .= 'NULL'; 575 569 } 576 570 else 577 571 { 578 $query_value [$query_value_index].= "'".$insert[$dbfield]."'";572 $query_value .= "'".$insert[$dbfield]."'"; 579 573 } 580 574 } 581 $query_value[$query_value_index] .= ')'; 582 } 583 584 $query_end .= ' 585 ;'; 586 foreach ($query_value as $value) 587 { 588 $final_query = $query_begin.$value.$query_end; 589 pwg_query($final_query); 590 } 575 $query_value .= ')'; 576 } 577 pwg_query($query_begin.$query_value); 591 578 } 592 579 } -
trunk/include/functions_html.inc.php
r1769 r1789 287 287 elseif ($url == '') 288 288 { 289 $output.= '<a class=""'; 290 $output.= ' href="' 289 $output.= '<a href="' 291 290 .make_index_url( 292 291 array( … … 300 299 else 301 300 { 302 $output.= '<a class=""'; 303 $output.= ' href="'.PHPWG_ROOT_PATH.$url.$id.'">'; 301 $output.= '<a href="'.PHPWG_ROOT_PATH.$url.$id.'">'; 304 302 $output.= $name.'</a>'; 305 303 } … … 369 367 { 370 368 $output.= ' 371 <a class="" 372 href="' 369 <a href="' 373 370 .make_index_url( 374 371 array( … … 382 379 { 383 380 $output.= ' 384 <a class="" 385 href="'.PHPWG_ROOT_PATH.$url.$category_id.'">'.$name.'</a>'; 381 <a href="'.PHPWG_ROOT_PATH.$url.$category_id.'">'.$name.'</a>'; 386 382 } 387 383 } -
trunk/include/functions_notification.inc.php
-
Property
svn:eol-style
set to
native
-
Property
svn:keywords
set to
Author Date Id Revision
r1784 r1789 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 6PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | branch : BSF (Best So Far) 8 // | file : $ RCSfile$9 // | last update : $Date : 2005-11-26 21:15:50 +0100 (sam., 26 nov. 2005)$10 // | last modifier : $Author : plg$11 // | revision : $Revision : 958$8 // | file : $Id$ 9 // | last update : $Date$ 10 // | last modifier : $Author$ 11 // | revision : $Revision$ 12 12 // +-----------------------------------------------------------------------+ 13 13 // | This program is free software; you can redistribute it and/or modify | … … 409 409 add_news_line( $news, 410 410 nb_new_elements($start, $end), '%d new element', '%d new elements', 411 get_root_url().'index.php?/recent_pics', $add_url );411 make_index_url(array('section'=>'recent_pics')), $add_url ); 412 412 } 413 413 … … 416 416 add_news_line( $news, 417 417 nb_updated_categories($start, $end), '%d category updated', '%d categories updated', 418 get_root_url().'/index.php?/recent_cats', $add_url );418 make_index_url(array('section'=>'recent_cats')), $add_url ); 419 419 } 420 420 -
Property
svn:eol-style
set to
-
trunk/include/functions_url.inc.php
r1788 r1789 2 2 // +-----------------------------------------------------------------------+ 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 // | Copyright (C) 2003-200 6PhpWebGallery Team - http://phpwebgallery.net |4 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 5 5 // +-----------------------------------------------------------------------+ 6 6 // | branch : BSF (Best So Far) 7 // | file : $ RCSfile$7 // | file : $Id$ 8 8 // | last update : $Date$ 9 9 // | last modifier : $Author$ … … 272 272 if (isset($params['flat_cat'])) 273 273 { 274 $url.= '/flat _cat';274 $url.= '/flat'; 275 275 } 276 276 -
trunk/include/section_init.inc.php
r1788 r1789 129 129 } 130 130 131 if (0 === strpos( $tokens[$next_token], 'categor'))131 if (0 === strpos(@$tokens[$next_token], 'categor')) 132 132 { 133 133 $page['section'] = 'categories'; … … 141 141 } 142 142 } 143 else if (0 === strpos( $tokens[$next_token], 'tag'))143 else if (0 === strpos(@$tokens[$next_token], 'tag')) 144 144 { 145 145 $page['section'] = 'tags'; … … 202 202 } 203 203 } 204 else if (0 === strpos( $tokens[$next_token], 'fav'))204 else if (0 === strpos(@$tokens[$next_token], 'fav')) 205 205 { 206 206 $page['section'] = 'favorites'; 207 207 $next_token++; 208 208 } 209 else if ('most_visited' == $tokens[$next_token])209 else if ('most_visited' == @$tokens[$next_token]) 210 210 { 211 211 $page['section'] = 'most_visited'; 212 212 $next_token++; 213 213 } 214 else if ('best_rated' == $tokens[$next_token])214 else if ('best_rated' == @$tokens[$next_token]) 215 215 { 216 216 $page['section'] = 'best_rated'; 217 217 $next_token++; 218 218 } 219 else if ('recent_pics' == $tokens[$next_token])219 else if ('recent_pics' == @$tokens[$next_token]) 220 220 { 221 221 $page['section'] = 'recent_pics'; 222 222 $next_token++; 223 223 } 224 else if ('recent_cats' == $tokens[$next_token])224 else if ('recent_cats' == @$tokens[$next_token]) 225 225 { 226 226 $page['section'] = 'recent_cats'; 227 227 $next_token++; 228 228 } 229 else if ('search' == $tokens[$next_token])229 else if ('search' == @$tokens[$next_token]) 230 230 { 231 231 $page['section'] = 'search'; … … 240 240 $next_token++; 241 241 } 242 else if ('list' == $tokens[$next_token])242 else if ('list' == @$tokens[$next_token]) 243 243 { 244 244 $page['section'] = 'list'; … … 269 269 else 270 270 { 271 if (!empty($conf['random_index_redirect'])) 271 $page['section'] = 'categories'; 272 if (script_basename() == 'picture') 273 {//access a picture only by id, file or id-file without given section 274 $page['flat_cat'] = true; 275 } 276 elseif (!empty($conf['random_index_redirect']) and empty($tokens[$next_token]) ) 272 277 { 273 278 $random_index_redirect = array(); … … 279 284 } 280 285 } 281 } 282 283 if (!empty($random_index_redirect)) 284 { 285 redirect($random_index_redirect[mt_rand(0, count($random_index_redirect)-1)]); 286 } 287 else 288 { 289 $page['section'] = 'categories'; 286 if (!empty($random_index_redirect)) 287 { 288 redirect($random_index_redirect[mt_rand(0, count($random_index_redirect)-1)]); 289 } 290 290 } 291 291 } … … 301 301 302 302 if ('categories' == $page['section'] and 303 'flat _cat' == $tokens[$i])303 'flat' == $tokens[$i]) 304 304 { 305 305 // indicate a special list of images -
trunk/template/yoga/mainpage_categories.tpl
r1771 r1789 7 7 <div class="illustration"> 8 8 <a href="{categories.category.URL}"> 9 <img src="{categories.category.SRC}" 10 alt="{categories.category.ALT}" 11 title="{categories.category.TITLE}"> 9 <img src="{categories.category.SRC}" alt="{categories.category.ALT}" title="{categories.category.TITLE}"> 12 10 </a> 13 11 </div> … … 18 16 </h3> 19 17 <p>{categories.category.CAPTION_NB_IMAGES}</p> 20 <p>{categories.category.DESCRIPTION} </p> <!-- to avoid a HTML warning -->18 <p>{categories.category.DESCRIPTION} </p> 21 19 </div> 22 20 </div> -
trunk/template/yoga/picture.tpl
r1787 r1789 205 205 <label>{lang:comment}<textarea name="content" rows="5" cols="80">{comments.add_comment.CONTENT}</textarea></label> 206 206 <input type="hidden" name="key" value="{comments.add_comment.KEY}" /> 207 <input class="submit" type="submit" class="submit"value="{lang:submit}">207 <input class="submit" type="submit" value="{lang:submit}"> 208 208 </fieldset> 209 209 </form>
Note: See TracChangeset
for help on using the changeset viewer.