Ir para conteúdo
Fórum Script Brasil

dumorim

Membros
  • Total de itens

    5
  • Registro em

  • Última visita

Sobre dumorim

dumorim's Achievements

0

Reputação

  1. dumorim

    script usando get

    página index aqui eu iria colocar um form da para gera um _GET <!DOCTYPE HTML> <html> <head> <title>Scroll Pagination</title> <link rel="stylesheet" type="text/css" href="style.css" /> <script src="jquery.js"> </script> <script src="javascript.js"> </script> <script type="text/javascript" src="//use.typekit.net/vue1oix.js"></script> <script type="text/javascript">try{Typekit.load();}catch(e){}</script> <style type="text/css"> </style> <script> $(document).ready(function() { $('#content').scrollPagination({ nop : 10, // The number of posts per scroll to be loaded offset : 0, // Initial offset, begins at 0 in this case error : 'No More Posts!', // When the user reaches the end this is the message that is // displayed. You can change this if you want. delay : 500, // When you scroll down the posts will load after a delayed amount of time. // This is mainly for usability concerns. You can alter this as you see fit scroll : true // The main bit, if set to false posts will not load as the user scrolls. // but will still load if the user clicks. }); }); </script> </head> <body> <div id="travel"> <a class="sub-head" href="http://www.inserthtml.com/2013/01/scroll-pagination/">&laquo; BACK TO ARTICLE</a> </div> <div id="content"> </div> </body> </html> aqui ele vai consulta a página ajax.php javascript (function($) { $.fn.scrollPagination = function(options) { var settings = { nop : 10, // The number of posts per scroll to be loaded offset : 0, // Initial offset, begins at 0 in this case error : 'No More Posts!', // When the user reaches the end this is the message that is // displayed. You can change this if you want. delay : 500, // When you scroll down the posts will load after a delayed amount of time. // This is mainly for usability concerns. You can alter this as you see fit scroll : true // The main bit, if set to false posts will not load as the user scrolls. // but will still load if the user clicks. } // Extend the options so they work with the plugin if(options) { $.extend(settings, options); } // For each so that we keep chainability. return this.each(function() { // Some variables $this = $(this); $settings = settings; var offset = $settings.offset; var busy = false; // Checks if the scroll action is happening // so we don't run it multiple times // Custom messages based on settings if($settings.scroll == true) $initmessage = 'Scroll for more or click here'; else $initmessage = 'Click for more'; // Append custom messages and extra UI $this.append('<div class="content"></div><div class="loading-bar">'+$initmessage+'</div>'); function getData() { // Post data to ajax.php $.post('ajax.php', { action : 'scrollpagination', number : $settings.nop, offset : offset, }, function(data) { // Change loading bar content (it may have been altered) $this.find('.loading-bar').html($initmessage); // If there is no data returned, there are no more posts to be shown. Show error if(data == "") { $this.find('.loading-bar').html($settings.error); } else { // Offset increases offset = offset+$settings.nop; // Append the data to the content div $this.find('.content').append(data); // No longer busy! busy = false; } }); } getData(); // Run function initially // If scrolling is enabled if($settings.scroll == true) { // .. and the user is scrolling $(window).scroll(function() { // Check the user is at the bottom of the element if($(window).scrollTop() + $(window).height() > $this.height() && !busy) { // Now we are working, so busy is true busy = true; // Tell the user we're loading posts $this.find('.loading-bar').html('Loading Posts'); // Run the function to fetch the data inside a delay // This is useful if you have content in a footer you // want the user to see. setTimeout(function() { getData(); }, $settings.delay); } }); } // Also content can be loaded by clicking the loading bar/ $this.find('.loading-bar').click(function() { if(busy == false) { busy = true; getData(); } }); }); } })(jQuery); aqui eu iria busca o _GET do form da página index sem passa pela página javascript pois si eu passa pela pagina javascript ele cria um bug e buga toda a pagina <?php mysql_connect('localhost', 'username', 'password') or die(); mysql_select_db('database'); $offset = is_numeric($_POST['offset']) ? $_POST['offset'] : die(); $postnumbers = is_numeric($_POST['number']) ? $_POST['number'] : die(); $run = mysql_query("SELECT * FROM wp_posts WHERE post_status = 'publish' AND post_type ='post' ORDER BY id DESC LIMIT ".$postnumbers." OFFSET ".$offset); while($row = mysql_fetch_array($run)) { $content = substr(strip_tags($row['post_content']), 0, 500); echo '<h1><a href="'.$row['guid'].'">'.$row['post_title'].'</a></h1><hr />'; echo '<p>'.$content.'...</p><hr />'; } ?> a unica coisa que quero que o _GET do index.php chega no ajax.php sem passa pelo o javascript.js mesmo que tenha que criar algum tipo de função para isso pois si ele passa pelo javascript.js ele faz um loop e o infinite trava qualquer ajuda é bem vida pessoal
  2. Gostaria de pedi ajuda a vocês para colocar o nome no centro da página que não estou dando conta antes de mais nada já gostaria de agradecer as respostas <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>CSS Menu Maker Installation Instructions</title> <style type="text/css"> body{padding:20px; font-size:14px; color:#000000; font-family:Arial, Helvetica, sans-serif;} h2 {font-weight:bold; color:#000099; margin:10px 0px; } p span {color:#006600; font-weight:bold; } a, a:link, a:visited {color:#0000FF;} textarea {width: 100%; padding: 10px; margin: 10px 0 15px 0; font-size: 13px; font-family: Consolas,monospace;} textarea.html {height: 300px;} p {margin: 0 0 10px 0;} code, pre {font-family: Consolas,monospace; color: green;} ol li {margin: 0 0 15px 0;} </style> </head> <body> <h2>Your Menu</h2> <style type="text/css">#cssmenu ul, #cssmenu li, #cssmenu span, #cssmenu a { margin: 0; padding: 0; position: relative; } #cssmenu { height: 49px; border-radius: 5px 5px 0 0; -moz-border-radius: 5px 5px 0 0; -webkit-border-radius: 5px 5px 0 0; background: #141414; background: -moz-linear-gradient(top, #32323a 0%, #141414 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414)); background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%); background: -o-linear-gradient(top, #32323a 0%, #141414 100%); background: -ms-linear-gradient(top, #32323a 0%, #141414 100%); background: linear-gradient(to bottom, #32323a 0%, #141414 100%); filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0); border-bottom: 2px solid #0fa1e0; } #cssmenu:after, #cssmenu ul:after { content: ''; display: block; clear: both; } #cssmenu a { background: #141414; background: -moz-linear-gradient(top, #32323a 0%, #141414 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414)); background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%); background: -o-linear-gradient(top, #32323a 0%, #141414 100%); background: -ms-linear-gradient(top, #32323a 0%, #141414 100%); background: linear-gradient(to bottom, #32323a 0%, #141414 100%); filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0); color: #ffffff; display: inline-block; font-family: Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 49px; padding: 0 20px; text-decoration: none; } #cssmenu ul { list-style: none; } #cssmenu > ul { float: left; } #cssmenu > ul > li { float: left; } #cssmenu > ul > li:hover:after { content: ''; display: block; width: 0; height: 0; position: absolute; left: 50%; bottom: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 10px solid #0fa1e0; margin-left: -10px; } #cssmenu > ul > li:first-child a { border-radius: 5px 0 0 0; -moz-border-radius: 5px 0 0 0; -webkit-border-radius: 5px 0 0 0; } #cssmenu > ul > li:last-child a { border-radius: 0 5px 0 0; -moz-border-radius: 0 5px 0 0; -webkit-border-radius: 0 5px 0 0; } #cssmenu > ul > li.active a { box-shadow: inset 0 0 3px #000000; -moz-box-shadow: inset 0 0 3px #000000; -webkit-box-shadow: inset 0 0 3px #000000; background: #070707; background: -moz-linear-gradient(top, #26262c 0%, #070707 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #26262c), color-stop(100%, #070707)); background: -webkit-linear-gradient(top, #26262c 0%, #070707 100%); background: -o-linear-gradient(top, #26262c 0%, #070707 100%); background: -ms-linear-gradient(top, #26262c 0%, #070707 100%); background: linear-gradient(to bottom, #26262c 0%, #070707 100%); filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#26262c', EndColorStr='#070707', GradientType=0); } #cssmenu > ul > li:hover > a { background: #070707; background: -moz-linear-gradient(top, #26262c 0%, #070707 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #26262c), color-stop(100%, #070707)); background: -webkit-linear-gradient(top, #26262c 0%, #070707 100%); background: -o-linear-gradient(top, #26262c 0%, #070707 100%); background: -ms-linear-gradient(top, #26262c 0%, #070707 100%); background: linear-gradient(to bottom, #26262c 0%, #070707 100%); filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#26262c', EndColorStr='#070707', GradientType=0); box-shadow: inset 0 0 3px #000000; -moz-box-shadow: inset 0 0 3px #000000; -webkit-box-shadow: inset 0 0 3px #000000; } #cssmenu .has-sub { z-index: 1; } #cssmenu .has-sub:hover > ul { display: block; } #cssmenu .has-sub ul { display: none; position: absolute; width: 200px; top: 100%; left: 0; } #cssmenu .has-sub ul li { *margin-bottom: -1px; } #cssmenu .has-sub ul li a { background: #0fa1e0; border-bottom: 1px dotted #6fc7ec; filter: none; font-size: 11px; display: block; line-height: 120%; padding: 10px; } #cssmenu .has-sub ul li:hover a { background: #0c7fb0; } #cssmenu .has-sub .has-sub:hover > ul { display: block; } #cssmenu .has-sub .has-sub ul { display: none; position: absolute; left: 100%; top: 0; } #cssmenu .has-sub .has-sub ul li a { background: #0c7fb0; border-bottom: 1px dotted #6db2d0; } #cssmenu .has-sub .has-sub ul li a:hover { background: #095c80; } </style> <div id='cssmenu'> <ul> <li><a href='#'><span>Home</span></a></li> <li class='has-sub '><a href='#'><span>Products</span></a> <ul> <li class='has-sub '><a href='#'><span>Product 1</span></a> <ul> <li><a href='#'><span>Sub Product</span></a></li> <li><a href='#'><span>Sub Product</span></a></li> </ul> </li> <li class='has-sub '><a href='#'><span>Product 2</span></a> <ul> <li><a href='#'><span>Sub Product</span></a></li> <li><a href='#'><span>Sub Product</span></a></li> </ul> </li> </ul> </li> <li><a href='#'><span>About</span></a></li> <li><a href='#'><span>Contact</span></a></li> </ul> </div> <div style="clear:both; margin: 0 0 30px 0;">&nbsp;</div> <h2>Installation Instructions</h2> <ol> <li>Upload the <code>menu_assets</code> folder to the root directory of your website. This is usually where your <code>index.html</code> file is.</li> <li>Copy and paste the code below somewhere between the <code>&lt;head>&lt;/head></code> tags.<textarea class='css'><link href="/menu_assets/styles.css" rel="stylesheet" type="text/css"></textarea></li> <li>Copy and paste the html below where ever you want your menu to show up.<textarea class='html'><div id='cssmenu'> <ul> <li><a href='#'><span>Home</span></a></li> <li class='has-sub '><a href='#'><span>Products</span></a> <ul> <li class='has-sub '><a href='#'><span>Product 1</span></a> <ul> <li><a href='#'><span>Sub Product</span></a></li> <li><a href='#'><span>Sub Product</span></a></li> </ul> </li> <li class='has-sub '><a href='#'><span>Product 2</span></a> <ul> <li><a href='#'><span>Sub Product</span></a></li> <li><a href='#'><span>Sub Product</span></a></li> </ul> </li> </ul> </li> <li><a href='#'><span>About</span></a></li> <li><a href='#'><span>Contact</span></a></li> </ul> </div></textarea></li> </ol> <h2>Notes</h2> <ol> <li>If you run into a problem getting your menu to work or have suggestions for the site please <a href='http://cssmenumaker.com/resources/contact'>Contact Us</a> and let us know. We will try to help as much as possible.</li> </ol> </body> </html>
  3. dumorim

    radio programação

    obrigado por ajuda mais a hora não esta aparecendo no echo somente em print como faço ela aparece em echo
  4. dumorim

    radio programação

    pessoal estou tentando colocar a programação da radio em meu site mais tenho um problema o startime seria a hora que o dj começa a toca e o endtime seria a hora que o dj vai para de toca mais não consigo fazer funcionar alquiem teria alguma ideia $day = date('D'); $time = mktime(date('H')-3, date('i'), date('s')); $hora = gmdate("H:i:s", $time); $query = "SELECT * FROM dj WHERE day = '$day' AND startime >= '$hora' AND endtime > '$hora' ORDER BY startime ASC LIMIT 1";
×
×
  • Criar Novo...