Changeset 154198
- Timestamp:
- 09/12/2009 10:40:13 PM (16 years ago)
- Location:
- vitrine-submarino
- Files:
-
- 3 added
- 2 edited
-
tags/3.3 (added)
-
tags/3.3/readme.txt (added)
-
tags/3.3/vitrinesubmarino.php (added)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/vitrinesubmarino.php (modified) (49 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vitrine-submarino/trunk/readme.txt
r118584 r154198 1 1 === Vitrine Submarino === 2 Contributors: Bernardo Bauer3 Donate link: http://bernabauer.com/ wp-plugins2 Contributors: bernabauer 3 Donate link: http://bernabauer.com/ 4 4 Tags: brasil, monetização, submarino, vitrine 5 Requires at least: 2. 76 Tested up to: 2. 77 Stable tag: 3. 25 Requires at least: 2.8 6 Tested up to: 2.8.4 7 Stable tag: 3.3 8 8 9 9 Mostra vitrine de produtos do Submarino.com. … … 11 11 == Description == 12 12 13 Mostre produtos do Submarino de acordo com as fontes RSS que o Submarino oferece. Você pode mostrar Mais Vendidos, Lançamentos e Promoções. Os produtos são coletados através do RSS e mostrados de maneira aleatória nas vitrines. É possível escolher uma categoria para cada tipo de vitrine de produtos.13 Mostre produtos do Submarino baseados em palavras chaves. A funcionalidade de pegar produtos através do feed RSS foi retirado nesta versão por que o Submarino deixou de atualizar os produtos desta maneira e não comunicou ou avisou as mudanças. 14 14 15 15 São duas funcionalidades distintas para o plugin. Widget e Vitrine Simples/Contextual. … … 19 19 Requer tema compatível com Widgets e mostra produtos baseados na escolha de uma palavra chave definida na página de administração. 20 20 21 **Vitrine Simples/Contextual**21 **Vitrine Contextual** 22 22 23 Vitrine Simples é vitrine que mostra produtos oriundos do RSS do Submarino. Já a Vitrine Contextual busca palavras cadastradas através do plugin Palavras de Monetização para mostrar produtos contextuais que estão na loja do Submarino.23 Busca palavras cadastradas através do plugin Palavras de Monetização para mostrar produtos contextuais que estão na loja do Submarino. 24 24 25 A novidade na versão 3.2 é que os produtos da Vitrine Contextual ficam armazenados localmente na base de dados do seu blog. O cache de produtos sempre é descartado a cada 24 horas pegando os produtos com suas descrições e preços a cada primeira visita que a palavra é pedida e não está na base de dados. Na página de administração do plugin é possível ver quantos produtos e palavras compõe o cache. 26 27 Com este cache local o Submarino não vai mais bloquear o seu blog para fazer a pesquisa de produtos em suas páginas. 25 Os produtos da Vitrine Contextual e do widget ficam armazenados localmente na base de dados do seu blog. O cache de produtos sempre é descartado a cada 24 horas pegando os produtos com suas descrições e preços a cada primeira visita que a palavra é pedida e não está na base de dados. Na página de administração do plugin é possível ver quantos produtos e palavras compõe o cache. 28 26 29 27 == Installation == … … 62 60 O plugin **requer PHP 5** ou superior para funcionar. Se o seu blog está usando a versão 4, não tem como o plugin mostrar a vitrine. Sorry! :-( 63 61 64 = Meu hospedeiro é a GoDaddy, e o plugin não funciona!!! =65 66 A GoDaddy é um tanto restritiva quanto ao que roda em seus sevidores. Apesar de ter criado um código especifico para a GoDaddy, a vitrine ainda assim parece não funcionar.67 68 62 = Como faço um reset nas configurações do plugin? Como removo o plugin totalmente? = 69 63 70 64 Basta habilitar a opção `Remover opções ao desativar`, atualizar as opções e depois desativar o plugin. Se quiser reabilitar o plugin, as configurações voltarão ao estado "de fábrica". 65 66 == Changelog == 67 68 = 3.3 = 69 * plugin agora entende as páginas de resultado de pesquisa para determinados produtos. 70 * consertado problema do link de afiliado que não aparecia na sintaxe correta. 71 * melhoria no tratamento da vitrine. 72 * introdução do primeiro slot diferenciado para pesquisa de preços. Slot diferenciado só aparece se existirem palavras cadastradas através do Palavras de Monetização. 73 * remoção das fontes de produtos via RSS (culpa do submarino que parou de atualizar o RSS com produtos novos.) 74 -
vitrine-submarino/trunk/vitrinesubmarino.php
r118584 r154198 4 4 Plugin URI: http://www.bernabauer.com/wp-plugins/ 5 5 Description: Mostre vitrines de produtos do Submarino em seu blog. Com o <a href="http://wordpress.org/extend/plugins/palavras-de-monetizacao/">Palavras de Monetização</a> você pode contextualizar manualmente os produtos. Para usar widgets é neecessário um tema compatível. 6 Version: 3. 26 Version: 3.3 7 7 Author: Bernardo Bauer 8 8 Author URI: http://www.bernabauer.com/ … … 25 25 */ 26 26 27 27 28 global $wpdb; 28 29 global $vs_options; 29 30 global $vs_version; 30 31 31 $vs_version = "3. 2";32 $vs_version = "3.3"; 32 33 $vs_options = get_option('vs_options'); 33 34 … … 52 53 add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'vs_plugin_actions' ); 53 54 54 /************************************************************************************************** *55 /************************************************************************************************** 55 56 * Coisas para serem feitas na instalacao do plugin 56 57 */ … … 76 77 'version'=> $vs_version, 77 78 'remover'=> 'nao', 79 'wid_title'=> 'Ofertas Submarino', 80 'wid_word'=> 'celular', 78 81 'wid_show'=> '3', 79 82 'wid_fontcolor'=> '#000000', … … 81 84 'wid_brdcolor'=> '#DDDDDD', 82 85 'wid_prcolor'=> '#3982C6', 83 'wid_title'=> 'Ofertas Submarino',84 86 'wid_track'=> 'nao', 85 'wid_rss_source'=> 'lan_Geral',86 87 'wid_altcode'=> 'BVD', 88 'ctx_titulo'=> '<h3>Ofertas Submarino</h3>', 89 'ctx_word'=> 'notebook', 90 'ctx_show'=> '4', 91 'ctx_exib_auto'=> 'auto', 92 'ctx_slot1'=> 'normal', 93 'ctx_tipo'=> 'horizontal', 94 'ctx_local'=> 'depois', 87 95 'ctx_prcolor'=> '#3982C6', 88 'ctx_tipo'=> 'horizontal',89 'ctx_local'=> 'depois',90 'ctx_show'=> '4',91 'ctx_word'=> 'notebook',92 'ctx_exib_auto'=> 'auto',93 'ctx_titulo'=> '<h3>Ofertas Submarino</h3>',94 96 'ctx_track'=> 'nao', 95 'ctx_rss_source'=> 'lan_Geral',96 97 'ctx_altcode'=> 'ctx_FBD', 97 98 ); 98 99 add_option('vs_options', $vs_options); 99 100 100 $sql = 'CREATE TABLE wp_vitrinesubmarino (101 nomep varchar(255) NOT NULL,102 linkp varchar(255) NOT NULL,103 imagemp varchar(255) NOT NULL,104 precop varchar(15) NOT NULL,105 rss_source varchar(15) NOT NULL106 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;';107 108 require_once(ABSPATH . 'wp-admin/includes/upgrade.php');109 dbDelta($sql);101 $sql = 'CREATE TABLE wp_vitrinesubmarino ( 102 nomep varchar(255) NOT NULL, 103 linkp varchar(255) NOT NULL, 104 imagemp varchar(255) NOT NULL, 105 precop varchar(15) NOT NULL, 106 rss_source varchar(255) NOT NULL 107 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;'; 108 109 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 110 dbDelta($sql); 110 111 111 112 } else { 112 113 if ($vs_options['version'] != $vs_version) { 113 $vs_options['version'] = $vs_version; 114 $vs_options = get_option('vs_options'); 115 $vs_options[ 'version'] = $vs_version; 116 $vs_options[ 'wid_word'] = 'celular'; 117 $vs_options[ 'ctx_word'] = 'notebook'; 118 $vs_options[ 'ctx_slot1'] = 'normal'; 114 119 update_option('vs_options', $vs_options); 115 120 } … … 221 226 } // 222 227 228 /************************************************************************************************** 229 * Cria banners dos produtos @@@ 230 */ 231 function vs_banner ($bannershow) { 232 233 global $vs_options; 234 235 $vs_options = get_option('vs_options'); 236 237 $banner = vs_core(1, 'celular', $bannershow, $vs_options['ctx_bgcolor'], $vs_options['ctx_brdcolor'], $vs_options['ctx_fontcolor'], $vs_options['ctx_prcolor']); 238 239 echo $banner; 240 } 241 242 243 223 244 /*************************************************************************************************** 224 245 * Função para chamada manual da vitrine. Não permite abas. … … 231 252 232 253 $current_plugins = get_option('active_plugins'); 233 234 254 if (in_array('palavras-de-monetizacao/palavrasmonetizacao.php', $current_plugins)) { 235 255 $words_array = pm_get_words(); … … 254 274 } 255 275 256 257 276 /*************************************************************************************************** 258 277 * Vitrine Automatica … … 263 282 264 283 $vs_options = get_option('vs_options'); 265 284 // 285 $current_plugins = get_option('active_plugins'); 286 if (in_array('palavras-de-monetizacao/palavrasmonetizacao.php', $current_plugins)) { 287 $words_array = pm_get_words(); 288 289 if (count($words_array) == 0) 290 $word = $vs_options['ctx_word']; 291 else 292 $word = $words_array[rand(0, count($words_array)-1)]; 293 } else { 294 $word = $vs_options['ctx_word']; 295 } 296 // 266 297 if ((is_single()) AND ($vs_options["ctx_exib_auto"] == 'auto')) { 267 298 … … 281 312 282 313 283 /** 284 * xml2array() will convert the given XML text to an array in the XML structure. 285 * Link: http://www.bin-co.com/php/scripts/xml2array/ 286 * Arguments : $contents - The XML text 287 * $get_attributes - 1 or 0. If this is 1 the function will get the attributes as well as the tag values - this results in a different array structure in the return value. 288 * $priority - Can be 'tag' or 'attribute'. This will change the way the resulting array sturcture. For 'tag', the tags are given more importance. 289 * Return: The parsed XML in an array form. Use print_r() to see the resulting array structure. 290 * Examples: $array = xml2array(file_get_contents('feed.xml')); 291 * $array = xml2array(file_get_contents('feed.xml', 1, 'attribute')); 314 /************************************************************************************************** 315 * pega produtos da base de dados 292 316 */ 293 function vs_xml2array($contents, $get_attributes=1, $priority = 'tag') { 294 if(!$contents) return array(); 295 296 if(!function_exists('xml_parser_create')) { 297 //print "'xml_parser_create()' function not found!"; 298 return array(); 299 } 300 301 //Get the XML parser of PHP - PHP must have this module for the parser to work 302 $parser = xml_parser_create(''); 303 xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8"); # http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss 304 xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); 305 xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); 306 xml_parse_into_struct($parser, trim($contents), $xml_values); 307 xml_parser_free($parser); 308 309 if(!$xml_values) return;//Hmm... 310 311 //Initializations 312 $xml_array = array(); 313 $parents = array(); 314 $opened_tags = array(); 315 $arr = array(); 316 317 $current = &$xml_array; //Refference 318 319 //Go through the tags. 320 $repeated_tag_index = array();//Multiple tags with same name will be turned into an array 321 foreach($xml_values as $data) { 322 unset($attributes,$value);//Remove existing values, or there will be trouble 323 324 //This command will extract these variables into the foreach scope 325 // tag(string), type(string), level(int), attributes(array). 326 extract($data);//We could use the array by itself, but this cooler. 327 328 $result = array(); 329 $attributes_data = array(); 330 331 if(isset($value)) { 332 if($priority == 'tag') $result = $value; 333 else $result['value'] = $value; //Put the value in a assoc array if we are in the 'Attribute' mode 334 } 335 336 //Set the attributes too. 337 if(isset($attributes) and $get_attributes) { 338 foreach($attributes as $attr => $val) { 339 if($priority == 'tag') $attributes_data[$attr] = $val; 340 else $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr' 341 } 342 } 343 344 //See tag status and do the needed. 345 if($type == "open") {//The starting of the tag '<tag>' 346 $parent[$level-1] = &$current; 347 if(!is_array($current) or (!in_array($tag, array_keys($current)))) { //Insert New tag 348 $current[$tag] = $result; 349 if($attributes_data) $current[$tag. '_attr'] = $attributes_data; 350 $repeated_tag_index[$tag.'_'.$level] = 1; 351 352 $current = &$current[$tag]; 353 354 } else { //There was another element with the same tag name 355 356 if(isset($current[$tag][0])) {//If there is a 0th element it is already an array 357 $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result; 358 $repeated_tag_index[$tag.'_'.$level]++; 359 } else {//This section will make the value an array if multiple tags with the same name appear together 360 $current[$tag] = array($current[$tag],$result);//This will combine the existing item and the new item together to make an array 361 $repeated_tag_index[$tag.'_'.$level] = 2; 362 363 if(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well 364 $current[$tag]['0_attr'] = $current[$tag.'_attr']; 365 unset($current[$tag.'_attr']); 366 } 367 368 } 369 $last_item_index = $repeated_tag_index[$tag.'_'.$level]-1; 370 $current = &$current[$tag][$last_item_index]; 371 } 372 373 } elseif($type == "complete") { //Tags that ends in 1 line '<tag />' 374 //See if the key is already taken. 375 if(!isset($current[$tag])) { //New Key 376 $current[$tag] = $result; 377 $repeated_tag_index[$tag.'_'.$level] = 1; 378 if($priority == 'tag' and $attributes_data) $current[$tag. '_attr'] = $attributes_data; 379 380 } else { //If taken, put all things inside a list(array) 381 if(isset($current[$tag][0]) and is_array($current[$tag])) {//If it is already an array... 382 383 // ...push the new element into that array. 384 $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result; 385 386 if($priority == 'tag' and $get_attributes and $attributes_data) { 387 $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data; 388 } 389 $repeated_tag_index[$tag.'_'.$level]++; 390 391 } else { //If it is not an array... 392 $current[$tag] = array($current[$tag],$result); //...Make it an array using using the existing value and the new value 393 $repeated_tag_index[$tag.'_'.$level] = 1; 394 if($priority == 'tag' and $get_attributes) { 395 if(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well 396 397 $current[$tag]['0_attr'] = $current[$tag.'_attr']; 398 unset($current[$tag.'_attr']); 399 } 400 401 if($attributes_data) { 402 $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data; 403 } 404 } 405 $repeated_tag_index[$tag.'_'.$level]++; //0 and 1 index is already taken 406 } 407 } 408 409 } elseif($type == 'close') { //End of tag '</tag>' 410 $current = &$parent[$level-1]; 411 } 412 } 413 414 return($xml_array); 415 } 416 417 /*************************************************************************************************** 418 * http://www.sourcerally.net/Scripts/39-Convert-HTML-Entities-to-XML-Entities 419 */ 420 421 function vs_xmlEntities($str) 422 { 423 $xml = array('"','&','&','<','>',' ','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','­','®','¯','°','±','²','³','´','µ','¶','·','¸','¹','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ'); 424 $html = array('"','&','&','<','>',' ','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','­','®','¯','°','±','²','³','´','µ','¶','·','¸','¹','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ'); 425 $str = str_replace($html,$xml,$str); 426 $str = str_ireplace($html,$xml,$str); 427 return $str; 428 } 429 430 431 /*************************************************************************************************** 432 * Funcao principal 433 */ 434 function vs_pegaprodutos_rss($rss_source) { 317 function vs_pegaprodutos($palavra){ 435 318 436 319 global $wpdb; 437 320 global $vs_options; 438 321 439 switch ($rss_source) { 440 441 case "mv_Bebes": 442 $rss_link = "/rss/rss-mais-vendidos?rss=30"; 443 break; 444 case "mv_Beleza": 445 $rss_link = "/rss/rss-mais-vendidos?rss=24"; 446 break; 447 case "mv_Brinquedos": 448 $rss_link = "/rss/rss-mais-vendidos?rss=3"; 449 break; 450 case "mv_Cama": 451 $rss_link = "/rss/rss-mais-vendidos?rss=36"; 452 break; 453 case "mv_Cameras": 454 $rss_link = "/rss/rss-mais-vendidos?rss=26"; 455 break; 456 case "mv_Celulares": 457 $rss_link = "/rss/rss-mais-vendidos?rss=11"; 458 break; 459 case "mv_CDs": 460 $rss_link = "/rss/rss-mais-vendidos?rss=2"; 461 break; 462 case "mv_DVD": 463 $rss_link = "/rss/rss-mais-vendidos?rss=6"; 464 break; 465 case "mv_Esporte": 466 $rss_link = "/rss/rss-mais-vendidos?rss=28"; 467 break; 468 case "mv_Eletrodomesticos": 469 $rss_link = "/rss/rss-mais-vendidos?rss=27"; 470 break; 471 case "mv_Eletronicos": 472 $rss_link = "/rss/rss-mais-vendidos?rss=13"; 473 break; 474 case "mv_Eletroportateis": 475 $rss_link = "/rss/rss-mais-vendidos?rss=34"; 476 break; 477 case "mv_Ferramentas": 478 $rss_link = "/rss/rss-mais-vendidos?rss=15"; 479 break; 480 case "mv_Games": 481 $rss_link = "/rss/rss-mais-vendidos?rss=12"; 482 break; 483 case "mv_Informatica": 484 $rss_link = "/rss/rss-mais-vendidos?rss=10"; 485 break; 486 case "mv_Instrumentos": 487 $rss_link = "/rss/rss-mais-vendidos?rss=32"; 488 break; 489 case "mv_Livros": 490 $rss_link = "/rss/rss-mais-vendidos?rss=1"; 491 break; 492 case "mv_livrosImportados": 493 $rss_link = "/rss/rss-mais-vendidos?rss=9"; 494 break; 495 case "mv_Papelaria": 496 $rss_link = "/rss/rss-mais-vendidos?rss=37"; 497 break; 498 case "mv_Perfumaria": 499 $rss_link = "/rss/rss-mais-vendidos?rss=33"; 500 break; 501 case "mv_Relogios": 502 $rss_link = "/rss/rss-mais-vendidos?rss=25"; 503 break; 504 case "mv_Utilidades": 505 $rss_link = "/rss/rss-mais-vendidos?rss=18"; 506 break; 507 case "mv_Vestuario": 508 $rss_link = "/rss/rss-mais-vendidos?rss=31"; 509 break; 510 case "mv_vinhos": 511 $rss_link = "/rss/rss-mais-vendidos?rss=35"; 512 break; 513 case "lan_Geral": 514 $rss_link = "/rss/rss-lancamentos"; 515 break; 516 case "lan_Bebes": 517 $rss_link = "/rss/rss-lancamentos?rss=30"; 518 break; 519 case "lan_Beleza": 520 $rss_link = "/rss/rss-lancamentos?rss=24"; 521 break; 522 case "lan_Brinquedos": 523 $rss_link = "/rss/rss-lancamentos?rss=3"; 524 break; 525 case "lan_Cama": 526 $rss_link = "/rss/rss-lancamentos?rss=36"; 527 break; 528 case "lan_Cameras": 529 $rss_link = "/rss/rss-lancamentos?rss=26"; 530 break; 531 case "lan_Celulares": 532 $rss_link = "/rss/rss-lancamentos?rss=11"; 533 break; 534 case "lan_CDs": 535 $rss_link = "/rss/rss-lancamentos?rss=2"; 536 break; 537 case "lan_DVD": 538 $rss_link = "/rss/rss-lancamentos?rss=6"; 539 break; 540 case "lan_Esporte": 541 $rss_link = "/rss/rss-lancamentos?rss=28"; 542 break; 543 case "lan_Eletrodomesticos": 544 $rss_link = "/rss/rss-lancamentos?rss=27"; 545 break; 546 case "lan_Eletronicos": 547 $rss_link = "/rss/rss-lancamentos?rss=13"; 548 break; 549 case "lan_Eletroportateis": 550 $rss_link = "/rss/rss-lancamentos?rss=34"; 551 break; 552 case "lan_Ferramentas": 553 $rss_link = "/rss/rss-lancamentos?rss=15"; 554 break; 555 case "lan_Games": 556 $rss_link = "/rss/rss-lancamentos?rss=12"; 557 break; 558 case "lan_Informatica": 559 $rss_link = "/rss/rss-lancamentos?rss=10"; 560 break; 561 case "lan_Instrumentos": 562 $rss_link = "/rss/rss-lancamentos?rss=32"; 563 break; 564 case "lan_Livros": 565 $rss_link = "/rss/rss-lancamentos?rss=1"; 566 break; 567 case "lan_livrosImportados": 568 $rss_link = "/rss/rss-lancamentos?rss=9"; 569 break; 570 case "lan_Papelaria": 571 $rss_link = "/rss/rss-lancamentos?rss=37"; 572 break; 573 case "lan_Perfumaria": 574 $rss_link = "/rss/rss-lancamentos?rss=33"; 575 break; 576 case "lan_Relogios": 577 $rss_link = "/rss/rss-lancamentos?rss=25"; 578 break; 579 case "lan_Utilidades": 580 $rss_link = "/rss/rss-lancamentos?rss=18"; 581 break; 582 case "lan_Vestuario": 583 $rss_link = "/rss/rss-lancamentos?rss=31"; 584 break; 585 case "lan_vinhos": 586 $rss_link = "/rss/rss-lancamentos?rss=35"; 587 break; 588 case "prom_Geral": 589 $rss_link = "/rss/rss-base"; 590 break; 591 case "prom_Bebes": 592 $rss_link = "/rss/rss-base?rss=30"; 593 break; 594 case "prom_Beleza": 595 $rss_link = "/rss/rss-base?rss=24"; 596 break; 597 case "prom_Brinquedos": 598 $rss_link = "/rss/rss-base?rss=3"; 599 break; 600 case "prom_Cama": 601 $rss_link = "/rss/rss-base?rss=36"; 602 break; 603 case "prom_Cameras": 604 $rss_link = "/rss/rss-base?rss=26"; 605 break; 606 case "prom_Celulares": 607 $rss_link = "/rss/rss-base?rss=11"; 608 break; 609 case "prom_CDs": 610 $rss_link = "/rss/rss-base?rss=2"; 611 break; 612 case "prom_DVD": 613 $rss_link = "/rss/rss-base?rss=6"; 614 break; 615 case "prom_Esporte": 616 $rss_link = "/rss/rss-base?rss=28"; 617 break; 618 case "prom_Eletrodomesticos": 619 $rss_link = "/rss/rss-base?rss=27"; 620 break; 621 case "prom_Eletronicos": 622 $rss_link = "/rss/rss-base?rss=13"; 623 break; 624 case "prom_Eletroportateis": 625 $rss_link = "/rss/rss-base?rss=34"; 626 break; 627 case "prom_Ferramentas": 628 $rss_link = "/rss/rss-base?rss=15"; 629 break; 630 case "prom_Games": 631 $rss_link = "/rss/rss-base?rss=12"; 632 break; 633 case "prom_Informatica": 634 $rss_link = "/rss/rss-base?rss=10"; 635 break; 636 case "prom_Instrumentos": 637 $rss_link = "/rss/rss-base?rss=32"; 638 break; 639 case "prom_Livros": 640 $rss_link = "/rss/rss-base?rss=1"; 641 break; 642 case "prom_livrosImportados": 643 $rss_link = "/rss/rss-base?rss=9"; 644 break; 645 case "prom_Papelaria": 646 $rss_link = "/rss/rss-base?rss=37"; 647 break; 648 case "prom_Perfumaria": 649 $rss_link = "/rss/rss-base?rss=33"; 650 break; 651 case "prom_Relogios": 652 $rss_link = "/rss/rss-base?rss=25"; 653 break; 654 case "prom_Utilidades": 655 $rss_link = "/rss/rss-base?rss=18"; 656 break; 657 case "prom_Vestuario": 658 $rss_link = "/rss/rss-base?rss=31"; 659 break; 660 case "prom_vinhos": 661 $rss_link = "/rss/rss-base?rss=35"; 662 break; 663 } 664 665 $response = vs_http_get($request, "www.submarino.com.br", $rss_link); 666 $data = vs_xmlEntities($response[1]); 667 668 $produtos = vs_xml2array($data,0); 669 670 $produtos2 = $produtos["rss"]["channel"]['item']; 671 672 if (count($produtos2) > 0) { 673 674 foreach ($produtos2 as $produto) { 675 676 $nome = $produto["title"]; 677 if (is_array($nome)) 678 $nome = ""; 679 680 $diz = $produto["description"]; 681 682 if (stripos($produto["link"], "?") === FALSE) { 683 $link_prod = $produto["link"]."?franq=".$vs_options['codafil']; 684 } else { 685 $link_prod = $produto["link"]."&franq=".$vs_options['codafil']; 686 } 687 688 preg_match_all('/<img[^>]+>/i',$diz, $result); 689 $imagem = $result[0][0]; 690 691 $preco = strip_tags("R".strrchr($diz, "$")); 692 693 if ($preco == "R") 694 $preco = ''; 695 696 $lprod .= "('" . $wpdb->escape($nome) . "','" . $wpdb->escape($link_prod) . "','" . $wpdb->escape($imagem) . "','" . $wpdb->escape($preco) . "', '". $wpdb->escape($rss_source) ."'), "; 697 } //foreach 698 699 //inclui $nome $link_prod $imagem e $preco no BD 700 $insert = "INSERT INTO wp_vitrinesubmarino (nomep, linkp, imagemp, precop, rss_source) VALUES " . rtrim($lprod, ", "); 701 $results = $wpdb->query( $insert ); 702 } 703 } 704 705 /*************************************************************************************************** 706 * pega produtos da base de dados 707 */ 708 function vs_pegaprodutos($vitrine){ 709 710 global $wpdb; 711 global $vs_options; 712 $word = ""; 713 714 if ($vitrine != "widget") { 715 $rss_source = $vs_options['ctx_rss_source']; 716 if ($rss_source == "ctx_contextual") { 717 $current_plugins = get_option('active_plugins'); 718 if (in_array('palavras-de-monetizacao/palavrasmonetizacao.php', $current_plugins)) { 719 $words_array = pm_get_words(); 720 if (count($words_array) == 0) 721 $word = $vs_options['ctx_word']; 722 else 723 $word = $words_array[rand(0, count($words_array)-1)]; 724 } else { 725 $word = $vs_options['ctx_word']; 726 } 727 $rss_source = $word; 322 $select = "SELECT * FROM wp_vitrinesubmarino WHERE rss_source = '". $palavra ."'"; 323 324 $results = $wpdb->get_results( $wpdb->prepare($select) , ARRAY_A); 325 326 if ($results == "") { 327 $results = vs_pesquisaprodutos($palavra); 328 } 329 330 echo "<!-- Produtos do Vitrine Submarino com a palavra: $palavra -->"; 331 332 return $results; 333 } 334 335 /******************************************************************* 336 * safe_mode and open_basedir workaround by http://www.edmondscommerce.co.uk/blog/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/ 337 */ 338 //follow on location problems workaround 339 function curl_redir_exec($ch) { 340 static $curl_loops = 0; 341 static $curl_max_loops = 20; 342 if ($curl_loops++>= $curl_max_loops) { 343 $curl_loops = 0; 344 return FALSE; 345 } 346 curl_setopt($ch, CURLOPT_HEADER, true); 347 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 348 $data = curl_exec($ch); 349 list($header, $data) = explode("\n\n", $data, 2); 350 $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); 351 if ($http_code == 301 || $http_code == 302) { 352 $matches = array(); 353 preg_match('/Location:(.*?)\n/', $header, $matches); 354 $url = @parse_url(trim(array_pop($matches))); 355 if (!$url) { 356 //couldn't process the url to redirect to 357 $curl_loops = 0; 358 return $data; 728 359 } 360 $last_url = parse_url(curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)); 361 if (!$url['scheme']) 362 $url['scheme'] = $last_url['scheme']; 363 if (!$url['host']) 364 $url['host'] = $last_url['host']; 365 if (!$url['path']) 366 $url['path'] = $last_url['path']; 367 $new_url = $url['scheme'] . '://' . $url['host'] . $url['path'] . ($url['query']?'?'.$url['query']:''); 368 curl_setopt($ch, CURLOPT_URL, $new_url); 369 return curl_redir_exec($ch); 729 370 } else { 730 $rss_source = $vs_options['wid_rss_source']; 731 } 732 733 $select = "SELECT * FROM wp_vitrinesubmarino WHERE rss_source = '". $rss_source ."'"; 734 $results = $wpdb->get_results( $select , ARRAY_A); 735 736 if (($results == "") AND ($word != "")) { 737 $results = vs_pesquisaprodutos($word); 738 } 739 740 return $results; 741 } 742 743 /*************************************************************************************************** 371 $curl_loops=0; 372 return $data; 373 } 374 } 375 function curl($url){ 376 $go = curl_init($url); 377 curl_setopt ($go, CURLOPT_URL, $url); 378 //follow on location problems 379 if (ini_get('open_basedir') == '' && ini_get('safe_mode' == 'Off')){ 380 curl_setopt ($go, CURLOPT_FOLLOWLOCATION, $l); 381 $syn = curl_exec($go); 382 }else{ 383 $syn = curl_redir_exec($go); 384 } 385 curl_close($go); 386 return $syn; 387 } 388 389 /************************************************************************************************** 744 390 * pega produtos da base de dados 745 391 */ … … 756 402 757 403 // Pego a pagina do produto procurado 404 /* 758 405 if(function_exists(curl_init)) { 759 760 406 $ch = curl_init(); 761 407 // informar URL e outras funcoes ao CURL … … 763 409 764 410 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 411 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); 765 412 // Acessar a URL e retornar a saida 766 413 $buffer = curl_exec($ch); 414 767 415 // liberar 768 416 curl_close($ch); 769 417 770 418 } else { 771 419 … … 773 421 774 422 } 775 423 */ 424 425 $buffer = curl($urlaserlida); 776 426 $doc = new DOMDocument(); 777 427 … … 807 457 $teste = $img->getAttribute("class"); 808 458 809 if($teste == 'name entry-title' ) {459 if($teste == 'name entry-title' OR $teste == 'name') { 810 460 $titulo[$i] = $img->nodeValue; 811 461 $i++; … … 828 478 829 479 if($teste == 'link') { 830 $link[$i] = "http://www.submarino.com.br".$img->getAttribute("href").' &franq='.$vs_options['codafil'];480 $link[$i] = "http://www.submarino.com.br".$img->getAttribute("href").'?franq='.$vs_options['codafil']; 831 481 $i++; 832 482 } … … 842 492 if ($lprod != '') { 843 493 $insert = "INSERT INTO wp_vitrinesubmarino (nomep, linkp, imagemp, precop, rss_source) VALUES " . rtrim($lprod, ", "); 844 $results = $wpdb->query( $insert ); 494 495 $results = $wpdb->query( $wpdb->prepare($insert) ); 845 496 } 846 497 847 498 $select = "SELECT * FROM wp_vitrinesubmarino WHERE rss_source = '". $palavra ."'"; 848 $produtos = $wpdb->get_results( $ select, ARRAY_A);499 $produtos = $wpdb->get_results( $wpdb->prepare($select) , ARRAY_A); 849 500 850 501 return $produtos; … … 852 503 853 504 854 /************************************************************************************************** *505 /************************************************************************************************** 855 506 * atualiza o cache 856 507 */ … … 862 513 #cache vai pras cucuias 863 514 $truncate = "TRUNCATE TABLE wp_vitrinesubmarino"; 864 $results = $wpdb->query( $ truncate);515 $results = $wpdb->query( $wpdb->prepare($truncate) ); 865 516 866 517 #atualiza palavra padrão da vitrine contextual 867 518 vs_pesquisaprodutos($vs_options['ctx_word']); 868 869 #atualiza produtos do RSS para vitrine simples 870 vs_pegaprodutos_rss($vs_options['ctx_rss_source']); 871 872 #atualiza produtos do RSS para vitrine widget se for diferente da vitrine simples 873 if ($vs_options['ctx_rss_source'] != $vs_options['wid_rss_source']) 874 vs_pegaprodutos_rss($vs_options['wid_rss_source']); 875 } 876 877 /*************************************************************************************************** 519 vs_pesquisaprodutos($vs_options['wid_word']); 520 521 } 522 523 /************************************************************************************************** 878 524 * Funcao principal 879 525 */ … … 886 532 global $vs_options; 887 533 global $vs_version; 534 $i=1; 888 535 889 536 if ($vs_options['codafil'] == '') … … 896 543 897 544 //pega produtos da BD (devolve um array) 898 $produtos = vs_pegaprodutos($vitrine); 545 546 $produtos = vs_pegaprodutos($word); 899 547 900 548 shuffle($produtos); 901 549 902 550 if (is_array($produtos)) { 903 551 904 552 foreach ($produtos as $produto) { 905 906 553 907 554 $nome = $produto['nomep']; … … 911 558 912 559 $tc = ''; 560 561 //código de tracking do Google Analytics dos links de comparação de preços 562 $tccp = 'onclick="javascript: pageTracker._trackPageview (\'/out/sub/compare/'.$vs_options['PCP'].'/'.$nome.'/\');"'; 913 563 914 $texto = $nome; 915 $texto = str_replace( " com ", " ", $texto ); 916 $texto = str_replace( " de ", " ", $texto ); 917 $texto = str_replace( " do ", " ", $texto ); 918 $texto = str_replace( " da ", " ", $texto ); 919 $texto = str_replace( " para ", " ", $texto ); 920 $texto = str_replace( " por ", " ", $texto ); 921 $pal = explode(" ", $texto); 922 $busca = $pal[0]." ".$pal[1]." ".$pal[2]." ".$pal[3]; 923 924 $tccp = 'onclick="javascript: pageTracker._trackPageview (\'/out/sub/compare/uol/'.$nome.'/\');"'; 925 926 //código de tracking do Google Analytics 564 //código de tracking do Google Analytics dos produtos da vitrine 927 565 $tc = 'onclick="javascript: pageTracker._trackPageview (\'/out/sub/'.$vitrine.'/'.$nome.'\');"'; 928 566 … … 933 571 $tc = ''; 934 572 } 935 936 //FIM do código de tracking 937 573 938 574 switch ($vs_options['PCP']) { 939 575 case "BP": … … 959 595 // vitrine contextual 960 596 if ($vs_options['ctx_tipo'] == "horizontal") { 961 $td = 100 / $vs_options['ctx_show']; 597 $td = 92 / $vs_options['ctx_show']; 598 $imagem = str_replace("<img ", "<img width=90px height=90px alt=\"".$nome."\"", $imagem); 599 $imagem = rtrim($imagem,"."); 600 962 601 //mostra vitrine com produtos em uma unica linha (VITRINE HORIZONTAL) 963 $lista_de_produtos .= '<div style="width:'. $td.'%;background-color:white;text-align:center;padding:0px;font-size:12px;border:0px;float:left;"><a href="'.$link_prod.'" '.$tc.' target="_blank">'.$imagem.'</a><br />'.$nome.'<br /><div style="color:'.$corprec.';">'.$preco.'</div>'.$compare_precos.'</div>'; 964 } else { 602 # $lista_de_produtos .= "<div onMouseover=\"ddrivetip('".$nome."', '#EFEFEF')\";=\"\" onMouseout=\"hideddrivetip()\">"; 603 $lista_de_produtos[] = '<div style="width:'. $td.'%;background-color:white;text-align:center; line-height:120%;padding-right: 10px;font-size:12px;border:0px;float:left;overflow: hidden;"><a href="'.$link_prod.'" '.$tc.' target="_blank"><span style="width:90px;height:90px;position:relative;">'.$imagem.'</span></a><br />'.$nome.'<br /><span style="color:'.$corprec.';"> '.$preco.' </span><br /><a href="'.$link_prod.'" '.$tc.' target="_blank"><strong>Veja mais</strong></a>'.$compare_precos.'</div>'; 604 605 } elseif ($vs_options['ctx_tipo'] == "vertical") { 965 606 $imagem = str_replace("<img ", "<img style=\" display: inline; float: left; margin: 0 10px 10px 0;\" alt=\"".$nome."\"", $imagem); 966 607 //mostra vitrine com um produto por linha (VITRINE VERTICAL) 967 $lista_de_produtos .= '<div style="height:130px;background-color:white;padding:3px;"><a href="'.$link_prod.'" '.$tc.' target="_blank">'.$imagem.'</a><a href="'.$link_prod.'" '.$tc.' target="_blank">'.$nome.'</a><br /><div style="color:'.$corprec.';">'.$preco.'</div>'.$compare_precos.'</div>'; 608 $lista_de_produtos[] = '<div style="height:130px;background-color:white;padding:3px;"><a href="'.$link_prod.'" '.$tc.' target="_blank">'.$imagem.'</a><a href="'.$link_prod.'" '.$tc.' target="_blank">'.$nome.'</a><br /><div style="color:'.$corprec.';">'.$preco.'</div>'.$compare_precos.'</div>'; 609 610 } elseif ($vs_options['ctx_tipo'] == "banner-468") { 611 $credits='<div style="position:absolute;bottom:0px;right:0px;"><small><a href="http://www.bernabauer.com/wp-plugins/">Vitrine Submarino '.$vs_options['version'].'</a></small></div>'; 612 $imagem = rtrim(str_replace("<img ", "<img style=\" display: inline; float: left; margin: 0 10px 0px 10px;height:60px;\" alt=\"".$nome."\"", $imagem), "."); 613 $lista_de_produtos[] = '<div style="border: 1px solid #ccc;color:'.$desc.';background-color:white;padding:3px;text-decoration: none ! important;width:468px;height:60px;position:relative;"><a href="http://www.submarino.com.br?franq='.$vs_options['codafil'].'" target="_blank"><img style=" display: inline; float: right; margin: 0 10px 0px 10px;" src="http://i.s8.com.br/images/affiliates/selos/70x70_selo.gif" WIDTH=40 HEIGHT=40 ></a><a href="'.$link_prod.'" '.$tc.' target="_blank">'.$imagem.'<font size="+1">'.$nome.'</font></a><br /><div style="color:'.$corprec.';font-size: 100%;">'.$preco.'</div>'.$compare_precos.''.$credits.'</div>'; 614 $i = $show; 615 616 } elseif ($vs_options['ctx_tipo'] == "box-250") { 617 $imagem = rtrim(str_replace("<img ", "<img width=90px height=90px alt=\"".$nome."\"", $imagem),"."); 618 # $lista_de_produtos .= "<div onMouseover=\"ddrivetip('".$nome."', '#EFEFEF')\";=\"\" onMouseout=\"hideddrivetip()\">"; 619 $lista_de_produtos[] = "<div style=\"width:110px;height:125px;background-color:white;text-align:center; line-height:120%;padding-left: 10px;font-size:12px;border:0px;float:left;overflow: hidden;\"><a href=\"".$link_prod.'" '.$tc.' target="_blank"><span style="width:90px;height:90px;position:relative;">'.$imagem.'<div style="color:'.$corprec.';font-size: 120%;background-color:white;position: absolute; bottom: 65px; right: 0px;"> '.$preco.' </div></span></a><br />'.$nome.''.$compare_precos.'</div></div>'; 968 620 } 969 621 break; 970 622 971 623 case "widget": 972 $lista_de_produtos .= '<div style="color:'.$desc.';background-color:'.$fundo.';text-align:center;padding:3px;text-decoration: none ! important;"><a href="'.$link_prod.'" '.$tc.' target="_blank">'.$imagem.'<br />'.$nome.'</a><br /><div style="color:'.$corprec.';">'.$preco.'</div>'.$compare_precos.'</div>'; 973 break; 974 624 # $imagem = rtrim(str_replace("<img ", "<img name=image".$i." onload=\"resizeimage('image".$i."');\"", $imagem), "."); 625 $lista_de_produtos[] = '<div style="color:'.$desc.';background-color:'.$fundo.';text-align:center;padding:3px;text-decoration: none ! important;"><a href="'.$link_prod.'" '.$tc.' target="_blank">'.$imagem.'<br />'.$nome.'</a><br /><div style="color:'.$corprec.';">'.$preco.'</div>'.$compare_precos.'</div>'; 626 break; 627 case "banner-728-1": 628 $credits='<div style="position:absolute;bottom:0px;right:0px;"><small><a href="http://www.bernabauer.com/wp-plugins/">Vitrine Submarino '.$vs_options['version'].'</a></small></div>'; 629 $imagem = rtrim(str_replace("<img ", "<img style=\" display: inline; float: left; margin: 0 10px 0px 10px;height:90px;\" alt=\"".$nome."\"", $imagem), "."); 630 $lista_de_produtos[] = '<div style="border: 1px solid #ccc;color:'.$desc.';background-color:white;padding:3px;text-decoration: none ! important;width:728px;height:90px;position:relative;"><a href="http://www.submarino.com.br?franq='.$vs_options['codafil'].'" target="_blank"><img style=" display: inline; float: right; margin: 0 10px 0px 10px;" src="http://i.s8.com.br/images/affiliates/selos/70x70_selo.gif"></a><a href="'.$link_prod.'" '.$tc.' target="_blank">'.$imagem.'<div style="font-size: 200%;">'.$nome.'</div></a><br /><div style="color:'.$corprec.';font-size: 150%;">'.$preco.'</div>'.$compare_precos.''.$credits.'</div>'; 631 $i = $show; 632 break; 633 634 case "banner-728-2": 635 $imagem = str_replace("<img ", "<img style=\" display: inline; margin: 0 10px 0px 10px;height:90px;\" alt=\"".$nome."\"", $imagem); 636 $lista_de_produtos[] = '<span style="position:relative;"><a href="'.$link_prod.'" '.$tc.' target="_blank" title="'.$nome.'">'.$imagem.'</a><div style="color:'.$corprec.';font-size: 100%;position: absolute; top: 0px; left: 10px;">'.$preco.'</div></span>'; 637 break; 638 975 639 } //switch 976 if ($i == $show-1) 640 641 # if ($vs_options['ctx_slot1'] != "normal" AND $i == $show-1) 642 # break; 643 644 if ($i >= $show) 977 645 break; 978 646 else 979 647 $i++; 980 648 } //foreach 981 982 649 650 #mostra primeiro slot diferenciado (adsense ou link de comparação de preços) 651 $current_plugins = get_option('active_plugins'); 652 if (in_array('palavras-de-monetizacao/palavrasmonetizacao.php', $current_plugins)) { 653 $words_array = pm_get_words(); 654 655 if ($vs_options['ctx_rss_source'] == "ctx_contextual" AND $words_array != '' AND $vs_options['ctx_slot1'] != "normal" AND $vitrine == "contextual" AND $vs_options['ctx_tipo'] == "horizontal" || $vs_options['ctx_tipo'] == "box-250") { 656 657 if (count($lista_de_produtos) >= $show) 658 $lixo = array_pop($lista_de_produtos); 659 660 foreach ($lista_de_produtos as $produto) { 661 $lista_final_de_produtos .= $produto; 662 } 663 664 $current_plugins = get_option('active_plugins'); 665 if (in_array('palavras-de-monetizacao/palavrasmonetizacao.php', $current_plugins)) 666 $words_array = pm_get_words(); 667 668 shuffle($words_array); 669 670 $compareprecoshead = '<strong>Compare Preços</strong><br />'; 671 672 switch($vs_options['ctx_slot1']) { 673 case "adsense": 674 $lista_final_de_produtos = '<div style="width:120px;height:125px;background-color:white;border:0px;float:left;"><div style="float:center; " align="center" >'.stripslashes($vs_options['adsense_code']).'</div></div>'.$lista_final_de_produtos; 675 break; 676 case "compareBP": 677 foreach ($words_array as $word) { 678 $compare_precos = "<a href=\"http://busca.buscape.com.br/cprocura?lkout=1&site_origem=".$cod_BP."&produto=".urlencode(utf8_decode($word))."\" ".$tccp." target='_blank'>".$word."</a><br />"; 679 $comparacao .= $compare_precos; 680 if ($u == 3) 681 break; 682 else 683 $u++; 684 } 685 $lista_final_de_produtos = '<div style="width:'. $td.'%;height:125px;background-color:white;border:0px;float:left;"><div style="float:center; " align="center" >'.$compareprecoshead.' '.rtrim($comparacao,"<br />").'</div></div>'.$lista_final_de_produtos; 686 break; 687 case "compareML": 688 foreach ($words_array as $word) { 689 $compare_precos = "<a href=\"http://pmstrk.mercadolivre.com.br/jm/PmsTrk?tool=".$cod_ML."&go=http://lista.mercadolivre.com.br/".urlencode($word)."\" ".$tccp." target='_blank'>".$word."</a><br />"; 690 $comparacao .= $compare_precos; 691 if ($u == 3) 692 break; 693 else 694 $u++; 695 } 696 $lista_final_de_produtos = '<div style="width:'. $td.'%;height:125px;background-color:white;border:0px;float:left;"><div style="float:center; " align="center" >'.$compareprecoshead.' '.rtrim($comparacao,"<br />").'</div></div>'.$lista_final_de_produtos; 697 break; 698 case "compareJC": 699 foreach ($words_array as $word) { 700 $compare_precos = "<a href=\"http://www.jacotei.com.br/mod.php?module=jacotei.pesquisa&texto=".urlencode($word)."&precomin=&precomax=&af=".$cod_JC."\" ".$tccp." target='_blank'>".$word."</a><br />"; 701 $comparacao .= $compare_precos; 702 if ($u == 3) 703 break; 704 else 705 $u++; 706 } 707 $lista_final_de_produtos = '<div style="width:'. $td.'%;height:125px;background-color:white;border:0px;float:left;"><div style="float:center; " align="center" >'.$compareprecoshead.' '.rtrim($comparacao,"<br />").'</div></div>'.$lista_final_de_produtos; 708 break; 709 case "compareBB": 710 foreach ($words_array as $word) { 711 $compare_precos = "<a href=\"http://bernabauer.shopping.busca.uol.com.br/busca.html?q=".urlencode(utf8_decode($word))."\" " .$tccp." target='_blank'>".$word."</a><br />"; 712 $comparacao .= $compare_precos; 713 if ($u == 3) 714 break; 715 else 716 $u++; 717 } 718 $lista_final_de_produtos = '<div style="width:'. $td.'%;height:125px;background-color:white;border:0px;float:left;"><div style="float:center; " align="center" >'.$compareprecoshead.' '.rtrim($comparacao,"<br />").'</div></div>'.$lista_final_de_produtos; 719 break; 720 721 } //switch 722 $show = $show-1; 723 } else { //if 724 foreach ($lista_de_produtos as $produto) { 725 $lista_final_de_produtos .= $produto; 726 } 727 } 728 } else { //if 729 foreach ($lista_de_produtos as $produto) { 730 $lista_final_de_produtos .= $produto; 731 } 732 } 733 734 $lista_de_produtos = $lista_final_de_produtos; 735 983 736 } else { 984 737 if ($vitrine == "contextual") { 985 738 // anuncio alternativo contextual 986 739 987 740 switch ($vs_options['ctx_altcode']) { 988 741 case "ctx_FBD": … … 997 750 case "ctx_SBG": 998 751 $altcode = '<script language="JavaScript1.1" type="text/javascript" src=http://www.submarino.com.br/afiliados/get_banner.asp?tipo=super2&franq='.$vs_options['codafil'].'></script>'; 752 break; 753 case "ctx_BVD": 754 $altcode = '<script language="JavaScript1.1" type="text/javascript" src=http://www.submarino.com.br/afiliados/get_banner.asp?tipo=vertical&franq='.$vs_options['codafil'].'></script>'; 755 break; 756 case "ctx_BVG": 757 $altcode = '<script language="JavaScript1.1" type="text/javascript" src=http://www.submarino.com.br/afiliados/get_banner.asp?tipo=vertical2&franq='.$vs_options['codafil'].'></script>'; 999 758 break; 1000 759 case "ctx_SKYD": … … 1035 794 $altcode = '<script language="JavaScript1.1" type="text/javascript" src=http://www.submarino.com.br/afiliados/get_banner.asp?tipo=vertical&franq='.$vs_options['codafil'].'></script>'; 1036 795 break; 1037 case "BV D":796 case "BVG": 1038 797 $altcode = '<script language="JavaScript1.1" type="text/javascript" src=http://www.submarino.com.br/afiliados/get_banner.asp?tipo=vertical2&franq='.$vs_options['codafil'].'></script>'; 1039 798 break; … … 1058 817 } //switch 1059 818 } //if 1060 return "<br clear=both/><div style=\"float:center;\" align=\"center\" border=\"0\">819 return "<br /><div style=\"float:center;\" align=\"center\" border=\"0\"> 1061 820 ".$altcode."</div>"; 1062 821 }# else { 1063 822 1064 $credits = "<br clear=both/><div style=\"text-align:right;\"><small><a href='http://www.bernabauer.com/wp-plugins/'>Vitrine Submarino ".$vs_options['version']."</a></small></div>";823 $credits = "<br /><div style=\"text-align:right;\"><small><a href='http://www.bernabauer.com/wp-plugins/'>Vitrine Submarino ".$vs_options['version']."</a></small></div>"; 1065 824 1066 825 if (($vitrine == "contextual") AND ($vs_options['ctx_exib_auto'] == 'auto')) … … 1069 828 $titulo = ''; 1070 829 830 if (strstr($vs_options['ctx_tipo'], "banner") != FALSE OR strstr($vitrine, "banner") != FALSE) { 831 $credits = "<br />"; 832 } 833 834 if (($vitrine == "contextual") AND ($vs_options['ctx_tipo'] == "box-250")) { 835 $box_antes = '<div style="width:250px;">'; 836 $box_depois = "</div>"; 837 } 838 839 840 1071 841 if ($vitrine == "widget") { 842 $widgetid = "id=\"vswi\""; 1072 843 $combordas = "border:2px solid ".$borda.";background-color:".$fundo.";"; 1073 844 } else 1074 845 $combordas = ''; 1075 846 1076 return "<br clear=both />".$titulo."<div style=\"".$combordas."\">".$lista_de_produtos."</div>".$credits;847 return "<br />".$box_antes.''.$titulo."<div ".$widgetid." style=\"".$combordas."\">".$lista_de_produtos."</div>".$credits.''.$box_depois; 1077 848 #} 1078 849 } 1079 850 1080 851 1081 /************************************************************************************************** *852 /************************************************************************************************** 1082 853 * Menu de configuracao 1083 854 */ … … 1088 859 } 1089 860 1090 /************************************************************************************************** *861 /************************************************************************************************** 1091 862 * Pagina de opcoes 1092 863 */ … … 1138 909 $vs_options['wid_prcolor'] = strip_tags(stripslashes($_POST['wid_prcolor'])); 1139 910 1140 $vs_options['wid_ rss_source'] = strip_tags(stripslashes($_POST['wid_rss_source']));911 $vs_options['wid_word'] = strip_tags(stripslashes($_POST['wid_word'])); 1141 912 $vs_options['wid_altcode'] = strip_tags(stripslashes($_POST['wid_altcode'])); 1142 913 $vs_options['wid_track'] = strip_tags(stripslashes($_POST['wid_track'])); … … 1154 925 1155 926 $vs_options['ctx_word'] = strip_tags(stripslashes($_POST['ctx_word'])); 1156 $vs_options['ctx_rss_source'] = strip_tags(stripslashes($_POST['ctx_rss_source']));1157 927 $vs_options['ctx_altcode'] = strip_tags(stripslashes($_POST['ctx_altcode'])); 1158 928 $vs_options['ctx_exib_auto'] = strip_tags(stripslashes($_POST['ctx_exib_auto'])); 929 $vs_options['ctx_slot1'] = strip_tags(stripslashes($_POST['ctx_slot1'])); 1159 930 $vs_options['ctx_local'] = strip_tags(stripslashes($_POST['ctx_local'])); 1160 931 $vs_options['ctx_track'] = strip_tags(stripslashes($_POST['ctx_track'])); … … 1162 933 $vs_options['ctx_style'] = strip_tags(stripslashes($_POST['ctx_style'])); 1163 934 $vs_options['ctx_alt'] = strip_tags(stripslashes($_POST['ctx_alt'])); 935 $vs_options['adsense_code'] = $_POST['adsense_code']; 1164 936 1165 937 //atualiza base de dados com informacaoes do formulario … … 1168 940 //atualiza o cache local de produtos com a nova configuracao 1169 941 vs_atualiza_produtos(); 1170 vs_pesquisaprodutos($vs_options['ctx_word']);942 # vs_pesquisaprodutos($vs_options['ctx_word']); 1171 943 } 1172 944 … … 1195 967 } 1196 968 1197 if ( $vs_options['ctx_tipo'] == 'horizontal') { 1198 $horizontal = 'checked=\"checked\"'; 1199 } else { 1200 $vertical = 'checked=\"checked\"'; 969 switch ( $vs_options['ctx_tipo'] ) { 970 case 'horizontal': 971 $horizontal = 'checked=\"checked\"'; 972 break; 973 case 'vertical': 974 $vertical = 'checked=\"checked\"'; 975 break; 976 case 'banner-468': 977 $banner468 = 'checked=\"checked\"'; 978 break; 979 case 'banner-728-1': 980 $banner7281 = 'checked=\"checked\"'; 981 break; 982 case 'box-250': 983 $banner250 = 'checked=\"checked\"'; 984 break; 1201 985 } 1202 986 … … 1206 990 $remover_sim = 'checked=\"checked\"'; 1207 991 } 992 993 switch ($vs_options['ctx_slot1']) { 994 case "adsense": 995 $slot1_adsense = 'checked=\"checked\"'; 996 break; 997 case "compareBP": 998 $slot1_compareBP = 'checked=\"checked\"'; 999 break; 1000 case "compareML": 1001 $slot1_compareML = 'checked=\"checked\"'; 1002 break; 1003 case "compareJC": 1004 $slot1_compareJC = 'checked=\"checked\"'; 1005 break; 1006 case "compareBB": 1007 $slot1_compareBB = 'checked=\"checked\"'; 1008 break; 1009 case "normal": 1010 $slot1_normal = 'checked=\"checked\"'; 1011 break; 1012 } 1208 1013 1209 1014 switch ($vs_options['wid_altcode']) { … … 1303 1108 } 1304 1109 1305 switch ($vs_options['wid_rss_source']) {1306 1307 case "mv_Bebes":1308 $wid_mv_Bebes = 'checked=\"checked\"';1309 break;1310 case "mv_Beleza":1311 $wid_mv_Beleza = 'checked=\"checked\"';1312 break;1313 case "mv_Brinquedos":1314 $wid_mv_Brinquedos = 'checked=\"checked\"';1315 break;1316 case "mv_Cama":1317 $wid_mv_Cama = 'checked=\"checked\"';1318 break;1319 case "mv_Cameras":1320 $wid_mv_Cameras = 'checked=\"checked\"';1321 break;1322 case "mv_Celulares":1323 $wid_mv_Celulares = 'checked=\"checked\"';1324 break;1325 case "mv_CDs":1326 $wid_mv_CDs = 'checked=\"checked\"';1327 break;1328 case "mv_DVD":1329 $wid_mv_DVD = 'checked=\"checked\"';1330 break;1331 case "mv_Esporte":1332 $wid_mv_Esporte = 'checked=\"checked\"';1333 break;1334 case "mv_Eletrodomesticos":1335 $wid_mv_Eletrodomesticos = 'checked=\"checked\"';1336 break;1337 case "mv_Eletronicos":1338 $wid_mv_Eletronicos = 'checked=\"checked\"';1339 break;1340 case "mv_Eletroportateis":1341 $wid_mv_Eletroportateis = 'checked=\"checked\"';1342 break;1343 case "mv_Ferramentas":1344 $wid_mv_Ferramentas = 'checked=\"checked\"';1345 break;1346 case "mv_Games":1347 $wid_mv_Games = 'checked=\"checked\"';1348 break;1349 case "mv_Informatica":1350 $wid_mv_Informatica = 'checked=\"checked\"';1351 break;1352 case "mv_Instrumentos":1353 $wid_mv_Instrumentos = 'checked=\"checked\"';1354 break;1355 case "mv_Livros":1356 $wid_mv_Livros = 'checked=\"checked\"';1357 break;1358 case "mv_livrosImportados":1359 $wid_mv_livrosImportados = 'checked=\"checked\"';1360 break;1361 case "mv_Papelaria":1362 $wid_mv_Papelaria = 'checked=\"checked\"';1363 break;1364 case "mv_Perfumaria":1365 $wid_mv_Perfumaria = 'checked=\"checked\"';1366 break;1367 case "mv_Relogios":1368 $wid_mv_Relogios = 'checked=\"checked\"';1369 break;1370 case "mv_Utilidades":1371 $wid_mv_Utilidades = 'checked=\"checked\"';1372 break;1373 case "mv_Vestuario":1374 $wid_mv_Vestuario = 'checked=\"checked\"';1375 break;1376 case "mv_vinhos":1377 $wid_mv_vinhos = 'checked=\"checked\"';1378 break;1379 case "lan_Geral":1380 $wid_lan_Geral = 'checked=\"checked\"';1381 break;1382 case "lan_Bebes":1383 $wid_lan_Bebes = 'checked=\"checked\"';1384 break;1385 case "lan_Beleza":1386 $wid_lan_Beleza = 'checked=\"checked\"';1387 break;1388 case "lan_Brinquedos":1389 $wid_lan_Brinquedos = 'checked=\"checked\"';1390 break;1391 case "lan_Cama":1392 $wid_lan_Cama = 'checked=\"checked\"';1393 break;1394 case "lan_Cameras":1395 $wid_lan_Cameras = 'checked=\"checked\"';1396 break;1397 case "lan_Celulares":1398 $wid_lan_Celulares = 'checked=\"checked\"';1399 break;1400 case "lan_CDs":1401 $wid_lan_CDs = 'checked=\"checked\"';1402 break;1403 case "lan_DVD":1404 $wid_lan_DVD = 'checked=\"checked\"';1405 break;1406 case "lan_Esporte":1407 $wid_lan_Esporte = 'checked=\"checked\"';1408 break;1409 case "lan_Eletrodomesticos":1410 $wid_lan_Eletrodomesticos = 'checked=\"checked\"';1411 break;1412 case "lan_Eletronicos":1413 $wid_lan_Eletronicos = 'checked=\"checked\"';1414 break;1415 case "lan_Eletroportateis":1416 $wid_lan_Eletroportateis = 'checked=\"checked\"';1417 break;1418 case "lan_Ferramentas":1419 $wid_lan_Ferramentas = 'checked=\"checked\"';1420 break;1421 case "lan_Games":1422 $wid_lan_Games = 'checked=\"checked\"';1423 break;1424 case "lan_Informatica":1425 $wid_lan_Informatica = 'checked=\"checked\"';1426 break;1427 case "lan_Instrumentos":1428 $wid_lan_Instrumentos = 'checked=\"checked\"';1429 break;1430 case "lan_Livros":1431 $wid_lan_Livros = 'checked=\"checked\"';1432 break;1433 case "lan_Papelaria":1434 $wid_lan_Papelaria = 'checked=\"checked\"';1435 break;1436 case "lan_Perfumaria":1437 $wid_lan_Perfumaria = 'checked=\"checked\"';1438 break;1439 case "lan_Relogios":1440 $wid_lan_Relogios = 'checked=\"checked\"';1441 break;1442 case "lan_Utilidades":1443 $wid_lan_Utilidades = 'checked=\"checked\"';1444 break;1445 case "lan_vinhos":1446 $wid_lan_vinhos = 'checked=\"checked\"';1447 break;1448 case "prom_Geral":1449 $wid_prom_Geral = 'checked=\"checked\"';1450 break;1451 case "prom_Beleza":1452 $wid_prom_Beleza = 'checked=\"checked\"';1453 break;1454 case "prom_Brinquedos":1455 $wid_prom_Brinquedos = 'checked=\"checked\"';1456 break;1457 case "prom_Cameras":1458 $wid_prom_Cameras = 'checked=\"checked\"';1459 break;1460 case "prom_Celulares":1461 $wid_prom_Celulares = 'checked=\"checked\"';1462 break;1463 case "prom_CDs":1464 $wid_prom_CDs = 'checked=\"checked\"';1465 break;1466 case "prom_DVD":1467 $wid_prom_DVD = 'checked=\"checked\"';1468 break;1469 case "prom_Esporte":1470 $wid_prom_Esporte = 'checked=\"checked\"';1471 break;1472 case "prom_Eletrodomesticos":1473 $wid_prom_Eletrodomesticos = 'checked=\"checked\"';1474 break;1475 case "prom_Eletronicos":1476 $wid_prom_Eletronicos = 'checked=\"checked\"';1477 break;1478 case "prom_Games":1479 $wid_prom_Games = 'checked=\"checked\"';1480 break;1481 case "prom_Livros":1482 $wid_prom_Livros = 'checked=\"checked\"';1483 break;1484 }1485 1486 switch ($vs_options['ctx_rss_source']) {1487 1488 case "ctx_contextual":1489 $ctx_contextual = 'checked=\"checked\"';1490 break;1491 case "mv_Bebes":1492 $ctx_mv_Bebes = 'checked=\"checked\"';1493 break;1494 case "mv_Beleza":1495 $ctx_mv_Beleza = 'checked=\"checked\"';1496 break;1497 case "mv_Brinquedos":1498 $ctx_mv_Brinquedos = 'checked=\"checked\"';1499 break;1500 case "mv_Cama":1501 $ctx_mv_Cama = 'checked=\"checked\"';1502 break;1503 case "mv_Cameras":1504 $ctx_mv_Cameras = 'checked=\"checked\"';1505 break;1506 case "mv_Celulares":1507 $ctx_mv_Celulares = 'checked=\"checked\"';1508 break;1509 case "mv_CDs":1510 $ctx_mv_CDs = 'checked=\"checked\"';1511 break;1512 case "mv_DVD":1513 $ctx_mv_DVD = 'checked=\"checked\"';1514 break;1515 case "mv_Esporte":1516 $ctx_mv_Esporte = 'checked=\"checked\"';1517 break;1518 case "mv_Eletrodomesticos":1519 $ctx_mv_Eletrodomesticos = 'checked=\"checked\"';1520 break;1521 case "mv_Eletronicos":1522 $ctx_mv_Eletronicos = 'checked=\"checked\"';1523 break;1524 case "mv_Eletroportateis":1525 $ctx_mv_Eletroportateis = 'checked=\"checked\"';1526 break;1527 case "mv_Ferramentas":1528 $ctx_mv_Ferramentas = 'checked=\"checked\"';1529 break;1530 case "mv_Games":1531 $ctx_mv_Games = 'checked=\"checked\"';1532 break;1533 case "mv_Informatica":1534 $ctx_mv_Informatica = 'checked=\"checked\"';1535 break;1536 case "mv_Instrumentos":1537 $ctx_mv_Instrumentos = 'checked=\"checked\"';1538 break;1539 case "mv_Livros":1540 $ctx_mv_Livros = 'checked=\"checked\"';1541 break;1542 case "mv_livrosImportados":1543 $ctx_mv_livrosImportados = 'checked=\"checked\"';1544 break;1545 case "mv_Papelaria":1546 $ctx_mv_Papelaria = 'checked=\"checked\"';1547 break;1548 case "mv_Perfumaria":1549 $ctx_mv_Perfumaria = 'checked=\"checked\"';1550 break;1551 case "mv_Relogios":1552 $ctx_mv_Relogios = 'checked=\"checked\"';1553 break;1554 case "mv_Utilidades":1555 $ctx_mv_Utilidades = 'checked=\"checked\"';1556 break;1557 case "mv_Vestuario":1558 $ctx_mv_Vestuario = 'checked=\"checked\"';1559 break;1560 case "mv_vinhos":1561 $ctx_mv_vinhos = 'checked=\"checked\"';1562 break;1563 case "lan_Geral":1564 $ctx_lan_Geral = 'checked=\"checked\"';1565 break;1566 case "lan_Bebes":1567 $ctx_lan_Bebes = 'checked=\"checked\"';1568 break;1569 case "lan_Beleza":1570 $ctx_lan_Beleza = 'checked=\"checked\"';1571 break;1572 case "lan_Brinquedos":1573 $ctx_lan_Brinquedos = 'checked=\"checked\"';1574 break;1575 case "lan_Cama":1576 $ctx_lan_Cama = 'checked=\"checked\"';1577 break;1578 case "lan_Cameras":1579 $ctx_lan_Cameras = 'checked=\"checked\"';1580 break;1581 case "lan_Celulares":1582 $ctx_lan_Celulares = 'checked=\"checked\"';1583 break;1584 case "lan_CDs":1585 $ctx_lan_CDs = 'checked=\"checked\"';1586 break;1587 case "lan_DVD":1588 $ctx_lan_DVD = 'checked=\"checked\"';1589 break;1590 case "lan_Esporte":1591 $ctx_lan_Esporte = 'checked=\"checked\"';1592 break;1593 case "lan_Eletrodomesticos":1594 $ctx_lan_Eletrodomesticos = 'checked=\"checked\"';1595 break;1596 case "lan_Eletronicos":1597 $ctx_lan_Eletronicos = 'checked=\"checked\"';1598 break;1599 case "lan_Eletroportateis":1600 $ctx_lan_Eletroportateis = 'checked=\"checked\"';1601 break;1602 case "lan_Ferramentas":1603 $ctx_lan_Ferramentas = 'checked=\"checked\"';1604 break;1605 case "lan_Games":1606 $ctx_lan_Games = 'checked=\"checked\"';1607 break;1608 case "lan_Informatica":1609 $ctx_lan_Informatica = 'checked=\"checked\"';1610 break;1611 case "lan_Instrumentos":1612 $ctx_lan_Instrumentos = 'checked=\"checked\"';1613 break;1614 case "lan_Livros":1615 $ctx_lan_Livros = 'checked=\"checked\"';1616 break;1617 case "lan_Papelaria":1618 $ctx_lan_Papelaria = 'checked=\"checked\"';1619 break;1620 case "lan_Perfumaria":1621 $ctx_lan_Perfumaria = 'checked=\"checked\"';1622 break;1623 case "lan_Relogios":1624 $ctx_lan_Relogios = 'checked=\"checked\"';1625 break;1626 case "lan_Utilidades":1627 $ctx_lan_Utilidades = 'checked=\"checked\"';1628 break;1629 case "lan_vinhos":1630 $ctx_lan_vinhos = 'checked=\"checked\"';1631 break;1632 case "prom_Geral":1633 $ctx_prom_Geral = 'checked=\"checked\"';1634 break;1635 case "prom_Beleza":1636 $ctx_prom_Beleza = 'checked=\"checked\"';1637 break;1638 case "prom_Brinquedos":1639 $ctx_prom_Brinquedos = 'checked=\"checked\"';1640 break;1641 case "prom_Cameras":1642 $ctx_prom_Cameras = 'checked=\"checked\"';1643 break;1644 case "prom_Celulares":1645 $ctx_prom_Celulares = 'checked=\"checked\"';1646 break;1647 case "prom_CDs":1648 $ctx_prom_CDs = 'checked=\"checked\"';1649 break;1650 case "prom_DVD":1651 $ctx_prom_DVD = 'checked=\"checked\"';1652 break;1653 case "prom_Esporte":1654 $ctx_prom_Esporte = 'checked=\"checked\"';1655 break;1656 case "prom_Eletrodomesticos":1657 $ctx_prom_Eletrodomesticos = 'checked=\"checked\"';1658 break;1659 case "prom_Eletronicos":1660 $ctx_prom_Eletronicos = 'checked=\"checked\"';1661 break;1662 case "prom_Games":1663 $ctx_prom_Games = 'checked=\"checked\"';1664 break;1665 case "prom_Livros":1666 $ctx_prom_Livros = 'checked=\"checked\"';1667 break;1668 }1669 1670 1110 1671 1111 ?> … … 1678 1118 <table class="form-table"> 1679 1119 <tr> 1680 <th scope="row" valign="top">Aviso</th> 1681 <td> 1682 Este plugin pega os produtos para serem mostrados em seu blog fornecidos através da <a href="http://www.submarino.com.br/portal/central-rss/?WT.mc_id=rss_left&WT.mc_ev=click" target=_blank>fonte de RSS que o Submarino fornece</a>. Para mostrar os produtos nas vitrines contextual e widget o plugin efetua um cache local que é atualizado uma vez por dia. Fique atento ao seguinte: A página de configuração do plugin pode demorar um pouco para carregar quando as configurações são alteradas. Isto ocorre por que neste momento é forçada uma atualização do cache local a partir da fonte RSS.<br /> 1683 <br /> 1684 <strong>Estatística do cache</strong><br /> 1120 <th scope="row" valign="top">Estatística</th> 1121 <td> 1685 1122 Produtos : 1686 1123 <?php 1687 $sql = "SELECT count( nomep ) as count FROM wp_vitrinesubmarino";1688 $results = $wpdb->get_results( $ sql, ARRAY_A);1124 $sql = "SELECT count( linkp ) as count FROM wp_vitrinesubmarino"; 1125 $results = $wpdb->get_results( $wpdb->prepare($sql) , ARRAY_A); 1689 1126 echo $results['0']['count']; 1690 1127 ?> … … 1693 1130 <?php 1694 1131 $sql = "SELECT count(distinct rss_source ) as count FROM wp_vitrinesubmarino"; 1695 $results = $wpdb->get_results( $ sql, ARRAY_A);1132 $results = $wpdb->get_results( $wpdb->prepare($sql) , ARRAY_A); 1696 1133 echo $results['0']['count']; 1697 1134 1698 1135 ?> 1699 <br />Próxima atualização do cache de produtos via RSS:1136 <br />Próxima limpeza do cache de produtos : 1700 1137 <?php 1701 1138 … … 1760 1197 1761 1198 <br /> 1762 <h2>Vitrine Simples/Contextual</h2> 1763 <?php 1764 1765 $current_plugins = get_option('active_plugins'); 1766 if (!in_array('palavras-de-monetizacao/palavrasmonetizacao.php', $current_plugins)) 1767 $PMdisabled = "DISABLED"; 1768 1769 ?> 1199 <h2>Vitrine Contextual</h2> 1770 1200 <table class="form-table"> 1771 1201 <tr> … … 1780 1210 <table class="form-table"> 1781 1211 <tr> 1212 <th scope="row" valign="top">Palavra de pesquisa da vitrine</th> 1213 <td> 1214 <input style="width: 60px;" id="ctx_word" name="ctx_word" type="text" value="<?php echo $vs_options['ctx_word']; ?>" <?php echo " ".$PM_Present; ?> /><label for="ctx_word"> Palavra padrão</label><br /> 1215 <br /> 1216 </td> 1217 </tr> 1218 </table> 1219 1220 <table class="form-table"> 1221 <tr> 1782 1222 <th scope="row" valign="top">Quant. Produtos</th> 1783 1223 <td> … … 1798 1238 Para mostrar a vitrine manualmente basta usar o código abaixo. As configurações são feitas nesta página.<br /> 1799 1239 <code><?php if(function_exists('vs_vitrine')) { vs_vitrine (); } ?></code><br /> 1800 O código deve ser inserido dentro do <a href="http://codex.wordpress.org/The_Loop" target="_blank">Loop</a>. 1801 </td> 1240 O código deve ser inserido dentro do <a href="http://codex.wordpress.org/The_Loop" target="_blank">Loop</a>.<br /><br /> 1241 </td> 1242 </tr> 1243 </table> 1244 1245 <table class="form-table"> 1246 <tr> 1247 <th scope="row" valign="top">Configuração da Vitrine</th> 1248 <td VALIGN="TOP"> 1249 Primeiro slot de produto deve ser diferenciado com <br /> 1250 <!-- 1251 <input type="radio" id="vitslot1a" name="ctx_slot1" value="adsense" <?php echo $slot1_adsense; ?> /> <label for="vitslot1a">Adsense</label> 1252 --> 1253 <br /> 1254 <input type="radio" id="vitslot1cBP" name="ctx_slot1" value="compareBP" <?php echo $slot1_compareBP; ?> /> <label for="vitslot1cBP">Comparação de Preços BuscaPé</label> 1255 <br /> 1256 <input type="radio" id="vitslot1cML" name="ctx_slot1" value="compareML" <?php echo $slot1_compareML; ?> /> <label for="vitslot1cML">Comparação de Preços Mercado Livre</label> 1257 <br /> 1258 <input type="radio" id="vitslot1cJC" name="ctx_slot1" value="compareJC" <?php echo $slot1_compareJC; ?> /> <label for="vitslot1cJC">Comparação de Preços Jacotei</label> 1259 <br /> 1260 <input type="radio" id="vitslot1cBB" name="ctx_slot1" value="compareBB" <?php echo $slot1_compareBB; ?> /> <label for="vitslot1cBB">Comparação de Preços Shopping bernabauer.com</label> 1261 <br /> 1262 <input type="radio" id="vitslot1n" name="ctx_slot1" value="normal" <?php echo $slot1_normal; ?> /> <label for="vitslot1n">Nada</label> 1263 <br /> 1264 </td> 1265 <!-- 1266 <td VALIGN="TOP"> 1267 <label for="adsense">Código Adsense</label><br /><textarea name="adsense_code" rows="5" cols="40" id="adsense"><?php echo stripslashes($vs_options['adsense_code']); ?></textarea> 1268 </td> 1269 --> 1802 1270 </tr> 1803 1271 </table> … … 1810 1278 <br /> 1811 1279 <input type="radio" id="vitver" name="ctx_tipo" value="vertical" <?php echo $vertical; ?> /> <label for="vitver">Vertical (um produto por linha)</label> 1280 <br /> 1281 <!-- 1282 <input type="radio" id="box-250" name="ctx_tipo" value="box-250" <?php echo $banner250; ?> /> <label for="box-250">Box 250x250 (até 4 produtos em 2 linhas)</label> 1283 <br /> 1284 <input type="radio" id="banner-468" name="ctx_tipo" value="banner-468" <?php echo $banner468; ?> /> <label for="banner-468">Banner 468x60</label> 1285 <br /> 1286 <input type="radio" id="banner-728-1" name="ctx_tipo" value="banner-728-1" <?php echo $banner7281; ?> /> <label for="banner-728-1">Banner 728x90</label> 1287 <br /> 1288 --> 1289 </td> 1290 </tr> 1291 </table> 1292 1293 <table class="form-table"> 1294 <tr> 1295 <th scope="row" valign="top">Localização da Vitrine</th> 1296 <td> 1297 Estas opções só funcionam caso a exibição da vitrine esteja configurada para automática.<br /> 1298 <input type="radio" name="ctx_local" id="vant" value="antes" <?php echo $antes; ?> /> <label for="vant">Antes do artigo</label> 1299 <br /> 1300 <input type="radio" name="ctx_local" id="vdep" value="depois" <?php echo $depois; ?> /> <label for="vdep">Depois do artigo</label> 1812 1301 <br /> 1813 1302 </td> … … 1827 1316 <table class="form-table"> 1828 1317 <tr> 1829 <th scope="row" valign="top">Fonte de Produtos<br />Veja mais informações sobre a fonte de produtos em RSS <a href="http://www.submarino.com.br/portal/central-rss/">aqui</a>.</th>1830 <td VALIGN="TOP">1831 <?php1832 if (in_array('palavras-de-monetizacao/palavrasmonetizacao.php', $current_plugins)) {1833 $PM_Present = "";1834 $PM_msg = '';1835 } else {1836 $PM_Present = "DISABLED";1837 $PM_msg = '<center>** Requer plugin <br /><a href="http://wordpress.org/extend/plugins/palavras-de-monetizacao/">Palavras de Monetização</a> <br />instalado e ativado. **</center>';1838 }1839 ?>1840 <input type="radio" name="ctx_rss_source" value="ctx_contextual" id="ctx_contextual" <?php echo $ctx_contextual; echo " ".$PM_Present; ?> /> <label for="ctx_contextual">Contextual</label>1841 <br />1842 <input style="width: 60px;" id="ctx_word" name="ctx_word" type="text" value="<?php echo $vs_options['ctx_word']; ?>" <?php echo " ".$PM_Present; ?> /><label for="ctx_word"> Palavra padrão</label><br />1843 <br />1844 <?php echo " ".$PM_msg; ?>1845 </td>1846 <td VALIGN="TOP">1847 <strong>Mais Vendidos RSS</strong><br />1848 <input type="radio" name="ctx_rss_source" value="mv_Bebes" id="ctx_mv_Bebes" <?php echo $ctx_mv_Bebes; ?> /> <label for="ctx_mv_Bebes">Bebês</label>1849 <br />1850 <input type="radio" name="ctx_rss_source" value="mv_Beleza" id="ctx_mv_Beleza" <?php echo $ctx_mv_Beleza; ?> /> <label for="ctx_mv_Beleza">Beleza & Saúde</label>1851 <br />1852 <input type="radio" name="ctx_rss_source" value="mv_Brinquedos" id="ctx_mv_Brinquedos" <?php echo $ctx_mv_Brinquedos; ?> /> <label for="ctx_mv_Brinquedos">Brinquedos</label>1853 <br />1854 <input type="radio" name="ctx_rss_source" value="mv_Cama" id="ctx_mv_Cama" <?php echo $ctx_mv_Cama; ?> /> <label for="ctx_mv_Cama">Cama, Mesa & banho</label>1855 <br />1856 <input type="radio" name="ctx_rss_source" value="mv_Cameras" id="ctx_mv_Cameras" <?php echo $ctx_mv_Cameras; ?> /> <label for="ctx_mv_Cameras">Câmeras Digitais & Filmadoras</label>1857 <br />1858 <input type="radio" name="ctx_rss_source" value="mv_Celulares" id="ctx_mv_Celulares" <?php echo $ctx_mv_Celulares; ?> /> <label for="ctx_mv_Celulares">Celulares & Telefonia Fixa</label>1859 <br />1860 <input type="radio" name="ctx_rss_source" value="mv_CDs" id="ctx_mv_CDs" <?php echo $ctx_mv_CDs; ?> /> <label for="ctx_mv_CDs">CDs</label>1861 <br />1862 <input type="radio" name="ctx_rss_source" value="mv_DVD" id="ctx_mv_DVD" <?php echo $ctx_mv_DVD; ?> /> <label for="ctx_mv_DVD">DVDs & Blu-ray</label>1863 <br />1864 <input type="radio" name="ctx_rss_source" value="mv_Esporte" id="ctx_mv_Esporte" <?php echo $ctx_mv_Esporte; ?> /> <label for="ctx_mv_Esporte">Esporte & Lazer</label>1865 <br />1866 <input type="radio" name="ctx_rss_source" value="mv_Eletrodomesticos" id="ctx_mv_Eletrodomesticos" <?php echo $ctx_mv_Eletrodomesticos; ?> /> <label for="ctx_mv_Eletrodomesticos">Eletrodomésticos</label>1867 <br />1868 <input type="radio" name="ctx_rss_source" value="mv_Eletronicos" id="ctx_mv_Eletronicos" <?php echo $ctx_mv_Eletronicos; ?> /> <label for="ctx_mv_Eletronicos">Eletrônicos Áudio & Vídeo</label>1869 <br />1870 <input type="radio" name="ctx_rss_source" value="mv_Eletroportateis" id="ctx_mv_Eletroportateis" <?php echo $ctx_mv_Eletroportateis; ?> /> <label for="ctx_mv_Eletroportateis">Eletroportáteis</label>1871 <br />1872 <input type="radio" name="ctx_rss_source" value="mv_Ferramentas" id="ctx_mv_Ferramentas" <?php echo $ctx_mv_Ferramentas; ?> /> <label for="ctx_mv_Ferramentas">Ferramentas</label>1873 <br />1874 <input type="radio" name="ctx_rss_source" value="mv_Games" id="ctx_mv_Games" <?php echo $ctx_mv_Games; ?> /> <label for="ctx_mv_Games">Games</label>1875 <br />1876 <input type="radio" name="ctx_rss_source" value="mv_Informatica" id="ctx_mv_Informatica" <?php echo $ctx_mv_Informatica; ?> /> <label for="ctx_mv_Informatica">Informática & Acessórios</label>1877 <br />1878 <input type="radio" name="ctx_rss_source" value="mv_Instrumentos" id="ctx_mv_Instrumentos" <?php echo $ctx_mv_Instrumentos; ?> /> <label for="ctx_mv_Instrumentos">Instrumentos Musicais</label>1879 <br />1880 <input type="radio" name="ctx_rss_source" value="mv_Livros" id="ctx_mv_Livros" <?php echo $ctx_mv_Livros; ?> /> <label for="ctx_mv_Livros">Livros</label>1881 <br />1882 <input type="radio" name="ctx_rss_source" value="mv_livrosImportados" id="ctx_mv_livrosImportados" <?php echo $ctx_mv_livrosImportados; ?> /> <label for="ctx_mv_livrosImportados">Livros Importados</label>1883 <br />1884 <input type="radio" name="ctx_rss_source" value="mv_Papelaria" id="ctx_mv_Papelaria" <?php echo $ctx_mv_Papelaria; ?> /> <label for="ctx_mv_Papelaria">Papelaria</label>1885 <br />1886 <input type="radio" name="ctx_rss_source" value="mv_Perfumaria" id="ctx_mv_Perfumaria" <?php echo $ctx_mv_Perfumaria; ?> /> <label for="ctx_mv_Perfumaria">Perfumaria</label>1887 <br />1888 <input type="radio" name="ctx_rss_source" value="mv_Relogios" id="ctx_mv_Relogios" <?php echo $ctx_mv_Relogios; ?> /> <label for="ctx_mv_Relogios">Relógios & Presentes</label>1889 <br />1890 <input type="radio" name="ctx_rss_source" value="mv_Utilidades" id="ctx_mv_Utilidades" <?php echo $ctx_mv_Utilidades; ?> /> <label for="ctx_mv_Utilidades">Utilidades Domésticas</label>1891 <br />1892 <input type="radio" name="ctx_rss_source" value="mv_Vestuario" id="ctx_mv_Vestuario" <?php echo $ctx_mv_Vestuario; ?> /> <label for="ctx_mv_Vestuario">Vestuário</label>1893 <br />1894 <input type="radio" name="ctx_rss_source" value="mv_vinhos" id="ctx_mv_vinhos" <?php echo $ctx_mv_vinhos; ?> /> <label for="ctx_mv_vinhos">Vinhos & Bebidas</label>1895 <br />1896 </td>1897 <td VALIGN="TOP">1898 <strong>Lançamento RSS</strong><br />1899 <input type="radio" name="ctx_rss_source" value="lan_Geral" id="ctx_lan_Geral" <?php echo $ctx_lan_Geral; ?> /> <label for="ctx_lan_Geral">Geral (Todo o Site)</label>1900 <br />1901 <input type="radio" name="ctx_rss_source" value="lan_Bebes" id="ctx_lan_Bebes" <?php echo $ctx_lan_Bebes; ?> /> <label for="ctx_lan_Bebes">Bebês</label>1902 <br />1903 <input type="radio" name="ctx_rss_source" value="lan_Beleza" id="ctx_lan_Beleza" <?php echo $ctx_lan_Beleza; ?> /> <label for="ctx_lan_Beleza">Beleza & Saúde</label>1904 <br />1905 <input type="radio" name="ctx_rss_source" value="lan_Brinquedos" id="ctx_lan_Brinquedos" <?php echo $ctx_lan_Brinquedos; ?> /> <label for="ctx_lan_Brinquedos">Brinquedos</label>1906 <br />1907 <input type="radio" name="ctx_rss_source" value="lan_Cama" id="ctx_lan_Cama" <?php echo $ctx_lan_Cama; ?> /> <label for="ctx_lan_Cama">Cama, Mesa & banho</label>1908 <br />1909 <input type="radio" name="ctx_rss_source" value="lan_Cameras" id="ctx_lan_Cameras" <?php echo $ctx_lan_Cameras; ?> /> <label for="ctx_lan_Cameras">Câmeras Digitais & Filmadoras</label>1910 <br />1911 <input type="radio" name="ctx_rss_source" value="lan_Celulares" id="ctx_lan_Celulares" <?php echo $ctx_lan_Celulares; ?> /> <label for="ctx_lan_Celulares">Celulares & Telefonia Fixa</label>1912 <br />1913 <input type="radio" name="ctx_rss_source" value="lan_CDs" id="ctx_lan_CDs" <?php echo $ctx_lan_CDs; ?> /> <label for="ctx_lan_CDs">CDs</label>1914 <br />1915 <input type="radio" name="ctx_rss_source" value="lan_DVD" id="ctx_lan_DVD" <?php echo $ctx_lan_DVD; ?> /> <label for="ctx_lan_DVD">DVDs & Blu-ray</label>1916 <br />1917 <input type="radio" name="ctx_rss_source" value="lan_Esporte" id="ctx_lan_Esporte" <?php echo $ctx_lan_Esporte; ?> /> <label for="ctx_lan_Esporte">Esporte & Lazer</label>1918 <br />1919 <input type="radio" name="ctx_rss_source" value="lan_Eletrodomesticos" id="ctx_lan_Eletrodomesticos" <?php echo $ctx_lan_Eletrodomesticos; ?> /> <label for="ctx_lan_Eletrodomesticos">Eletrodomésticos</label>1920 <br />1921 <input type="radio" name="ctx_rss_source" value="lan_Eletronicos" id="ctx_lan_Eletronicos" <?php echo $ctx_lan_Eletronicos; ?> /> <label for="ctx_lan_Eletronicos">Eletrônicos Áudio & Vídeo</label>1922 <br />1923 <input type="radio" name="ctx_rss_source" value="lan_Eletroportateis" id="ctx_lan_Eletroportateis" <?php echo $ctx_lan_Eletroportateis; ?> /> <label for="ctx_lan_Eletroportateis">Eletroportáteis</label>1924 <br />1925 <input type="radio" name="ctx_rss_source" value="lan_Ferramentas" id="ctx_lan_Ferramentas" <?php echo $ctx_lan_Ferramentas; ?> /> <label for="ctx_lan_Ferramentas">Ferramentas</label>1926 <br />1927 <input type="radio" name="ctx_rss_source" value="lan_Games" id="ctx_lan_Games" <?php echo $ctx_lan_Games; ?> /> <label for="ctx_lan_Games">Games</label>1928 <br />1929 <input type="radio" name="ctx_rss_source" value="lan_Informatica" id="ctx_lan_Informatica" <?php echo $ctx_lan_Informatica; ?> /> <label for="ctx_lan_Informatica">Informática & Acessórios</label>1930 <br />1931 <input type="radio" name="ctx_rss_source" value="lan_Instrumentos" id="ctx_lan_Instrumentos" <?php echo $ctx_lan_Instrumentos; ?> /> <label for="ctx_lan_Instrumentos">Instrumentos Musicais</label>1932 <br />1933 <input type="radio" name="ctx_rss_source" value="lan_Livros" id="ctx_lan_Livros" <?php echo $ctx_lan_Livros; ?> /> <label for="ctx_lan_Livros">Livros</label>1934 <br />1935 <input type="radio" name="ctx_rss_source" value="lan_Papelaria" id="ctx_lan_Papelaria" <?php echo $ctx_lan_Papelaria; ?> /> <label for="ctx_lan_Papelaria">Papelaria</label>1936 <br />1937 <input type="radio" name="ctx_rss_source" value="lan_Perfumaria" id="ctx_lan_Perfumaria" <?php echo $ctx_lan_Perfumaria; ?> /> <label for="ctx_lan_Perfumaria">Perfumaria</label>1938 <br />1939 <input type="radio" name="ctx_rss_source" value="lan_Relogios" id="ctx_lan_Relogios" <?php echo $ctx_lan_Relogios; ?> /> <label for="ctx_lan_Relogios">Relógios & Presentes</label>1940 <br />1941 <input type="radio" name="ctx_rss_source" value="lan_Utilidades" id="ctx_lan_Utilidades" <?php echo $ctx_lan_Utilidades; ?> /> <label for="ctx_lan_Utilidades">Utilidades Domésticas</label>1942 <br />1943 <input type="radio" name="ctx_rss_source" value="lan_vinhos" id="ctx_lan_vinhos" <?php echo $ctx_lan_vinhos; ?> /> <label for="ctx_lan_vinhos">Vinhos & Bebidas</label>1944 <br />1945 </td>1946 <td VALIGN="TOP">1947 <strong>Promoção RSS</strong><br />1948 <input type="radio" name="ctx_rss_source" value="prom_Geral" id="ctx_prom_Geral" <?php echo $ctx_prom_Geral; ?> /> <label for="ctx_prom_Geral">Geral (Todo o Site)</label>1949 <br />1950 <input type="radio" name="ctx_rss_source" value="prom_Beleza" id="ctx_prom_Beleza" <?php echo $ctx_prom_Beleza; ?> /> <label for="ctx_prom_Beleza">Beleza & Saúde</label>1951 <br />1952 <input type="radio" name="ctx_rss_source" value="prom_Brinquedos" id="ctx_prom_Brinquedos" <?php echo $ctx_prom_Brinquedos; ?> /> <label for="ctx_prom_Brinquedos">Brinquedos</label>1953 <br />1954 <input type="radio" name="ctx_rss_source" value="prom_Cameras" id="ctx_prom_Cameras" <?php echo $ctx_prom_Cameras; ?> /> <label for="ctx_prom_Cameras">Câmeras Digitais & Filmadoras</label>1955 <br />1956 <input type="radio" name="ctx_rss_source" value="prom_Celulares" id="ctx_prom_Celulares" <?php echo $ctx_prom_Celulares; ?> /> <label for="ctx_prom_Celulares">Celulares & Telefonia Fixa</label>1957 <br />1958 <input type="radio" name="ctx_rss_source" value="prom_CDs" id="ctx_prom_CDs" <?php echo $ctx_prom_CDs; ?> /> <label for="ctx_prom_CDs">CDs</label>1959 <br />1960 <input type="radio" name="ctx_rss_source" value="prom_DVD" id="ctx_prom_DVD" <?php echo $ctx_prom_DVD; ?> /> <label for="ctx_prom_DVD">DVDs & Blu-ray</label>1961 <br />1962 <input type="radio" name="ctx_rss_source" value="prom_Esporte" id="ctx_prom_Esporte" <?php echo $ctx_prom_Esporte; ?> /> <label for="ctx_prom_Esporte">Esporte & Lazer</label>1963 <br />1964 <input type="radio" name="ctx_rss_source" value="prom_Eletrodomesticos" id="ctx_prom_Eletrodomesticos" <?php echo $ctx_prom_Eletrodomesticos; ?> /> <label for="ctx_prom_Eletrodomesticos">Eletrodomésticos</label>1965 <br />1966 <input type="radio" name="ctx_rss_source" value="prom_Eletronicos" id="ctx_prom_Eletronicos" <?php echo $ctx_prom_Eletronicos; ?> /> <label for="ctx_prom_Eletronicos">Eletrônicos Áudio & Vídeo</label>1967 <br />1968 <input type="radio" name="ctx_rss_source" value="prom_Games" id="ctx_prom_Games" <?php echo $ctx_prom_Games; ?> /> <label for="ctx_prom_Games">Games</label>1969 <br />1970 <input type="radio" name="ctx_rss_source" value="prom_Livros" id="ctx_prom_Livros" <?php echo $ctx_prom_Livros; ?> /> <label for="ctx_prom_Livros">Livros</label>1971 <br />1972 </td>1973 </tr>1974 </table>1975 <br />1976 1977 <table class="form-table">1978 <tr>1979 1318 <th scope="row" valign="top">Rastrear Cliques</th> 1980 1319 <td> … … 2021 1360 2022 1361 2023 <table class="form-table">2024 <tr>2025 <th scope="row" valign="top">Localização da Vitrine</th>2026 <td>2027 Estas opções só funcionam caso a exibição da vitrine esteja configurada para automática.<br />2028 <input type="radio" name="ctx_local" id="vant" value="antes" <?php echo $antes; ?> /> <label for="vant">Antes do artigo</label>2029 <br />2030 <input type="radio" name="ctx_local" id="vdep" value="depois" <?php echo $depois; ?> /> <label for="vdep">Depois do artigo</label>2031 <br />2032 </td>2033 </tr>2034 </table>2035 2036 1362 2037 1363 <br /> … … 2045 1371 <input id="wid_title" name="wid_title" type="text" value="<?php echo $vs_options['wid_title']; ?>" /><br /> 2046 1372 <label for="wid_title">Este é o texto que será mostrado acima da vitrine.</label><br /> 1373 </td> 1374 </tr> 1375 </table> 1376 1377 <table class="form-table"> 1378 <tr> 1379 <th scope="row" valign="top">Palavra de pesquisa da vitrine</th> 1380 <td> 1381 <input style="width: 60px;" id="wid_word" name="wid_word" type="text" value="<?php echo $vs_options['wid_word']; ?>" /><label for="wid_word"> Palavra padrão</label><br /> 1382 <br /> 2047 1383 </td> 2048 1384 </tr> … … 2072 1408 </tr> 2073 1409 </table> 2074 2075 <table class="form-table">2076 <tr>2077 <th scope="row" valign="top">Fonte RSS de Produtos<br />Veja mais informações <a href="http://www.submarino.com.br/portal/central-rss/">aqui</a>.</th>2078 <td VALIGN="TOP">2079 <strong>Mais Vendidos</strong><br />2080 <input type="radio" name="wid_rss_source" value="mv_Bebes" id="wid_mv_Bebes" <?php echo $wid_mv_Bebes; ?> /> <label for="wid_mv_Bebes">Bebês</label>2081 <br />2082 <input type="radio" name="wid_rss_source" value="mv_Beleza" id="wid_mv_Beleza" <?php echo $wid_mv_Beleza; ?> /> <label for="wid_mv_Beleza">Beleza & Saúde</label>2083 <br />2084 <input type="radio" name="wid_rss_source" value="mv_Brinquedos" id="wid_mv_Brinquedos" <?php echo $wid_mv_Brinquedos; ?> /> <label for="wid_mv_Brinquedos">Brinquedos</label>2085 <br />2086 <input type="radio" name="wid_rss_source" value="mv_Cama" id="wid_mv_Cama" <?php echo $wid_mv_Cama; ?> /> <label for="wid_mv_Cama">Cama, Mesa & banho</label>2087 <br />2088 <input type="radio" name="wid_rss_source" value="mv_Cameras" id="wid_mv_Cameras" <?php echo $wid_mv_Cameras; ?> /> <label for="wid_mv_Cameras">Câmeras Digitais & Filmadoras</label>2089 <br />2090 <input type="radio" name="wid_rss_source" value="mv_Celulares" id="wid_mv_Celulares" <?php echo $wid_mv_Celulares; ?> /> <label for="wid_mv_Celulares">Celulares & Telefonia Fixa</label>2091 <br />2092 <input type="radio" name="wid_rss_source" value="mv_CDs" id="wid_mv_CDs" <?php echo $wid_mv_CDs; ?> /> <label for="wid_mv_CDs">CDs</label>2093 <br />2094 <input type="radio" name="wid_rss_source" value="mv_DVD" id="wid_mv_DVD" <?php echo $wid_mv_DVD; ?> /> <label for="wid_mv_DVD">DVDs & Blu-ray</label>2095 <br />2096 <input type="radio" name="wid_rss_source" value="mv_Esporte" id="wid_mv_Esporte" <?php echo $wid_mv_Esporte; ?> /> <label for="wid_mv_Esporte">Esporte & Lazer</label>2097 <br />2098 <input type="radio" name="wid_rss_source" value="mv_Eletrodomesticos" id="wid_mv_Eletrodomesticos" <?php echo $wid_mv_Eletrodomesticos; ?> /> <label for="wid_mv_Eletrodomesticos">Eletrodomésticos</label>2099 <br />2100 <input type="radio" name="wid_rss_source" value="mv_Eletronicos" id="wid_mv_Eletronicos" <?php echo $wid_mv_Eletronicos; ?> /> <label for="wid_mv_Eletronicos">Eletrônicos Áudio & Vídeo</label>2101 <br />2102 <input type="radio" name="wid_rss_source" value="mv_Eletroportateis" id="wid_mv_Eletroportateis" <?php echo $wid_mv_Eletroportateis; ?> /> <label for="wid_mv_Eletroportateis">Eletroportáteis</label>2103 <br />2104 <input type="radio" name="wid_rss_source" value="mv_Ferramentas" id="wid_mv_Ferramentas" <?php echo $wid_mv_Ferramentas; ?> /> <label for="wid_mv_Ferramentas">Ferramentas</label>2105 <br />2106 <input type="radio" name="wid_rss_source" value="mv_Games" id="wid_mv_Games" <?php echo $wid_mv_Games; ?> /> <label for="wid_mv_Games">Games</label>2107 <br />2108 <input type="radio" name="wid_rss_source" value="mv_Informatica" id="wid_mv_Informatica" <?php echo $wid_mv_Informatica; ?> /> <label for="wid_mv_Informatica">Informática & Acessórios</label>2109 <br />2110 <input type="radio" name="wid_rss_source" value="mv_Instrumentos" id="wid_mv_Instrumentos" <?php echo $wid_mv_Instrumentos; ?> /> <label for="wid_mv_Instrumentos">Instrumentos Musicais</label>2111 <br />2112 <input type="radio" name="wid_rss_source" value="mv_Livros" id="wid_mv_Livros" <?php echo $wid_mv_Livros; ?> /> <label for="wid_mv_Livros">Livros</label>2113 <br />2114 <input type="radio" name="wid_rss_source" value="mv_livrosImportados" id="wid_mv_livrosImportados" <?php echo $wid_mv_livrosImportados; ?> /> <label for="wid_mv_livrosImportados">Livros Importados</label>2115 <br />2116 <input type="radio" name="wid_rss_source" value="mv_Papelaria" id="wid_mv_Papelaria" <?php echo $wid_mv_Papelaria; ?> /> <label for="wid_mv_Papelaria">Papelaria</label>2117 <br />2118 <input type="radio" name="wid_rss_source" value="mv_Perfumaria" id="wid_mv_Perfumaria" <?php echo $wid_mv_Perfumaria; ?> /> <label for="wid_mv_Perfumaria">Perfumaria</label>2119 <br />2120 <input type="radio" name="wid_rss_source" value="mv_Relogios" id="wid_mv_Relogios" <?php echo $wid_mv_Relogios; ?> /> <label for="wid_mv_Relogios">Relógios & Presentes</label>2121 <br />2122 <input type="radio" name="wid_rss_source" value="mv_Utilidades" id="wid_mv_Utilidades" <?php echo $wid_mv_Utilidades; ?> /> <label for="wid_mv_Utilidades">Utilidades Domésticas</label>2123 <br />2124 <input type="radio" name="wid_rss_source" value="mv_Vestuario" id="wid_mv_Vestuario" <?php echo $wid_mv_Vestuario; ?> /> <label for="wid_mv_Vestuario">Vestuário</label>2125 <br />2126 <input type="radio" name="wid_rss_source" value="mv_vinhos" id="wid_mv_vinhos" <?php echo $wid_mv_vinhos; ?> /> <label for="wid_mv_vinhos">Vinhos & Bebidas</label>2127 <br />2128 </td>2129 <td VALIGN="TOP">2130 <strong>Lançamento</strong><br />2131 <input type="radio" name="wid_rss_source" value="lan_Geral" id="wid_lan_Geral" <?php echo $wid_lan_Geral; ?> /> <label for="wid_lan_Geral">Geral (Todo o Site)</label>2132 <br />2133 <input type="radio" name="wid_rss_source" value="lan_Bebes" id="wid_lan_Bebes" <?php echo $wid_lan_Bebes; ?> /> <label for="wid_lan_Bebes">Bebês</label>2134 <br />2135 <input type="radio" name="wid_rss_source" value="lan_Beleza" id="wid_lan_Beleza" <?php echo $wid_lan_Beleza; ?> /> <label for="wid_lan_Beleza">Beleza & Saúde</label>2136 <br />2137 <input type="radio" name="wid_rss_source" value="lan_Brinquedos" id="wid_lan_Brinquedos" <?php echo $wid_lan_Brinquedos; ?> /> <label for="wid_lan_Brinquedos">Brinquedos</label>2138 <br />2139 <input type="radio" name="wid_rss_source" value="lan_Cama" id="wid_lan_Cama" <?php echo $wid_lan_Cama; ?> /> <label for="wid_lan_Cama">Cama, Mesa & banho</label>2140 <br />2141 <input type="radio" name="wid_rss_source" value="lan_Cameras" id="wid_lan_Cameras" <?php echo $wid_lan_Cameras; ?> /> <label for="wid_lan_Cameras">Câmeras Digitais & Filmadoras</label>2142 <br />2143 <input type="radio" name="wid_rss_source" value="lan_Celulares" id="wid_lan_Celulares" <?php echo $wid_lan_Celulares; ?> /> <label for="wid_lan_Celulares">Celulares & Telefonia Fixa</label>2144 <br />2145 <input type="radio" name="wid_rss_source" value="lan_CDs" id="wid_lan_CDs" <?php echo $wid_lan_CDs; ?> /> <label for="wid_lan_CDs">CDs</label>2146 <br />2147 <input type="radio" name="wid_rss_source" value="lan_DVD" id="wid_lan_DVD" <?php echo $wid_lan_DVD; ?> /> <label for="wid_lan_DVD">DVDs & Blu-ray</label>2148 <br />2149 <input type="radio" name="wid_rss_source" value="lan_Esporte" id="wid_lan_Esporte" <?php echo $wid_lan_Esporte; ?> /> <label for="wid_lan_Esporte">Esporte & Lazer</label>2150 <br />2151 <input type="radio" name="wid_rss_source" value="lan_Eletrodomesticos" id="wid_lan_Eletrodomesticos" <?php echo $wid_lan_Eletrodomesticos; ?> /> <label for="wid_lan_Eletrodomesticos">Eletrodomésticos</label>2152 <br />2153 <input type="radio" name="wid_rss_source" value="lan_Eletronicos" id="wid_lan_Eletronicos" <?php echo $wid_lan_Eletronicos; ?> /> <label for="wid_lan_Eletronicos">Eletrônicos Áudio & Vídeo</label>2154 <br />2155 <input type="radio" name="wid_rss_source" value="lan_Eletroportateis" id="wid_lan_Eletroportateis" <?php echo $wid_lan_Eletroportateis; ?> /> <label for="wid_lan_Eletroportateis">Eletroportáteis</label>2156 <br />2157 <input type="radio" name="wid_rss_source" value="lan_Ferramentas" id="wid_lan_Ferramentas" <?php echo $wid_lan_Ferramentas; ?> /> <label for="wid_lan_Ferramentas">Ferramentas</label>2158 <br />2159 <input type="radio" name="wid_rss_source" value="lan_Games" id="wid_lan_Games" <?php echo $wid_lan_Games; ?> /> <label for="wid_lan_Games">Games</label>2160 <br />2161 <input type="radio" name="wid_rss_source" value="lan_Informatica" id="wid_lan_Informatica" <?php echo $wid_lan_Informatica; ?> /> <label for="wid_lan_Informatica">Informática & Acessórios</label>2162 <br />2163 <input type="radio" name="wid_rss_source" value="lan_Instrumentos" id="wid_lan_Instrumentos" <?php echo $wid_lan_Instrumentos; ?> /> <label for="wid_lan_Instrumentos">Instrumentos Musicais</label>2164 <br />2165 <input type="radio" name="wid_rss_source" value="lan_Livros" id="wid_lan_Livros" <?php echo $wid_lan_Livros; ?> /> <label for="wid_lan_Livros">Livros</label>2166 <br />2167 <input type="radio" name="wid_rss_source" value="lan_Papelaria" id="wid_lan_Papelaria" <?php echo $wid_lan_Papelaria; ?> /> <label for="wid_lan_Papelaria">Papelaria</label>2168 <br />2169 <input type="radio" name="wid_rss_source" value="lan_Perfumaria" id="wid_lan_Perfumaria" <?php echo $wid_lan_Perfumaria; ?> /> <label for="wid_lan_Perfumaria">Perfumaria</label>2170 <br />2171 <input type="radio" name="wid_rss_source" value="lan_Relogios" id="wid_lan_Relogios" <?php echo $wid_lan_Relogios; ?> /> <label for="wid_lan_Relogios">Relógios & Presentes</label>2172 <br />2173 <input type="radio" name="wid_rss_source" value="lan_Utilidades" id="wid_lan_Utilidades" <?php echo $wid_lan_Utilidades; ?> /> <label for="wid_lan_Utilidades">Utilidades Domésticas</label>2174 <br />2175 <input type="radio" name="wid_rss_source" value="lan_vinhos" id="wid_lan_vinhos" <?php echo $wid_lan_vinhos; ?> /> <label for="wid_lan_vinhos">Vinhos & Bebidas</label>2176 <br />2177 </td>2178 <td VALIGN="TOP">2179 <strong>Promoção</strong><br />2180 <input type="radio" name="wid_rss_source" value="prom_Geral" id="wid_prom_Geral" <?php echo $wid_prom_Geral; ?> /> <label for="wid_prom_Geral">Geral (Todo o Site)</label>2181 <br />2182 <input type="radio" name="wid_rss_source" value="prom_Beleza" id="wid_prom_Beleza" <?php echo $wid_prom_Beleza; ?> /> <label for="wid_prom_Beleza">Beleza & Saúde</label>2183 <br />2184 <input type="radio" name="wid_rss_source" value="prom_Brinquedos" id="wid_prom_Brinquedos" <?php echo $wid_prom_Brinquedos; ?> /> <label for="wid_prom_Brinquedos">Brinquedos</label>2185 <br />2186 <input type="radio" name="wid_rss_source" value="prom_Cameras" id="wid_prom_Cameras" <?php echo $wid_prom_Cameras; ?> /> <label for="wid_prom_Cameras">Câmeras Digitais & Filmadoras</label>2187 <br />2188 <input type="radio" name="wid_rss_source" value="prom_Celulares" id="wid_prom_Celulares" <?php echo $wid_prom_Celulares; ?> /> <label for="wid_prom_Celulares">Celulares & Telefonia Fixa</label>2189 <br />2190 <input type="radio" name="wid_rss_source" value="prom_CDs" id="wid_prom_CDs" <?php echo $wid_prom_CDs; ?> /> <label for="wid_prom_CDs">CDs</label>2191 <br />2192 <input type="radio" name="wid_rss_source" value="prom_DVD" id="wid_prom_DVD" <?php echo $wid_prom_DVD; ?> /> <label for="wid_prom_DVD">DVDs & Blu-ray</label>2193 <br />2194 <input type="radio" name="wid_rss_source" value="prom_Esporte" id="wid_prom_Esporte" <?php echo $wid_prom_Esporte; ?> /> <label for="wid_prom_Esporte">Esporte & Lazer</label>2195 <br />2196 <input type="radio" name="wid_rss_source" value="prom_Eletrodomesticos" id="wid_prom_Eletrodomesticos" <?php echo $wid_prom_Eletrodomesticos; ?> /> <label for="wid_prom_Eletrodomesticos">Eletrodomésticos</label>2197 <br />2198 <input type="radio" name="wid_rss_source" value="prom_Eletronicos" id="wid_prom_Eletronicos" <?php echo $wid_prom_Eletronicos; ?> /> <label for="wid_prom_Eletronicos">Eletrônicos Áudio & Vídeo</label>2199 <br />2200 <input type="radio" name="wid_rss_source" value="prom_Games" id="wid_prom_Games" <?php echo $wid_prom_Games; ?> /> <label for="wid_prom_Games">Games</label>2201 <br />2202 <input type="radio" name="wid_rss_source" value="prom_Livros" id="wid_prom_Livros" <?php echo $wid_prom_Livros; ?> /> <label for="wid_prom_Livros">Livros</label>2203 <br />2204 </td>2205 </tr>2206 </table>2207 <br />2208 2209 1410 <table class="form-table"> 2210 1411 <tr> … … 2261 1462 } 2262 1463 2263 /************************************************************************************************** *1464 /************************************************************************************************** 2264 1465 * Link para configuração do plugin na página de administração de plugins 2265 1466 */ … … 2271 1472 return $links; 2272 1473 } 2273 /************************************************************************************************** *1474 /************************************************************************************************** 2274 1475 * Configuracao do widget 2275 1476 */ … … 2297 1498 // start list 2298 1499 echo '<ul>'; 1500 2299 1501 // were there any posts found? 2300 1502 $prod = vs_core ( $vs_options['wid_show'], $vs_options['wid_word'], "widget", $vs_options['wid_bgcolor'], $vs_options['wid_brdcolor'], $vs_options['wid_fontcolor'], $vs_options['wid_prcolor'], $vs_options['wid_procolor'], $vs_options['wid_prccolor']) ; … … 2313 1515 wp_register_sidebar_widget('vitrine-submarino', 'Vitrine Submarino', 'widget_Submarino', $widget_ops); 2314 1516 } 2315 function vs_http_get($request, $host, $path, $port = 80) { 2316 2317 global $wp_version; 2318 global $vs_options; 2319 2320 $http_request = "GET $path HTTP/1.0\r\n"; 2321 $http_request .= "Host: $host\r\n"; 2322 $http_request .= "Content-Type: application/x-www-form-urlencoded; charset=" . get_option('blog_charset') . "\r\n"; 2323 $http_request .= "Content-Length: " . strlen($request) . "\r\n"; 2324 $http_request .= "User-Agent: WordPress/$wp_version | vitrine-submarino/".$vs_options['version']."\r\n"; 2325 $http_request .= "\r\n"; 2326 $http_request .= $request; 2327 2328 $response = ''; 2329 if( false != ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) { 2330 fwrite($fs, $http_request); 2331 2332 while ( !feof($fs) ) 2333 $response .= fgets($fs, 1160); // One TCP-IP packet 2334 fclose($fs); 2335 $response = explode("\r\n\r\n", $response, 2); 2336 } 2337 return $response; 2338 } 1517 2339 1518 ?>
Note: See TracChangeset
for help on using the changeset viewer.