w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
AngularJS application hosted on Github pages (gh-pages) ajax crawling
BromBone (http://www.brombone.com/) claims to offer that _escaped_fragment_ handling as a service for you. However, it's a commercial service. I guess it would matter how important it was to you for those pages to work with Google.

Categories : Ajax

Pagination won't move through pages
Maybe global variables is not "enable" on the server. Using register globals has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0 Why? Try this way: instead of this lines: if (!(isset($pagenum))){ $pagenum = 1; } use: if (!isset($_GET['pagenum'])){ $pagenum = 1; } else { $pagenum = $_GET['pagenum']; }

Categories : PHP

PHP Pagination with x amount of pages
you can try LIMIT with in your query itself SELECT * FROM TABLE_NAME LIMIT STARTING_RESULT_NUMBER, RESULTS_PER_PAGE RESULTS_PER_PAGE is no.of items per page you want to display STARTING_RESULT_NUMBER =(CURRENT_PAGE_NUMBER*RESULTS_PER_PAGE)

Categories : PHP

How do i impliment pagination here (only for the next pages)
The class variable (@@current) is a bad idea because it is shared among all users. You can simply use a parameter with the index method: class StarsController < ApplicationController def index @page = params[:page] || 1 @videos = @client.videos_by(:tags=>{:include=>[:cover,:acoustic]},:page=> @page) end end In the view <%= link_to "next", :action=>"index", :page => @page + 1 %>

Categories : Ruby On Rails

How can I generate pagination when looping through pages rather than posts?
Read a bunch at https://codex.wordpress.org/Pagination The Bones theme by Themble has an entire custom built code base for their own pagination function. Its awesome and easy to use. I would study that as well in Bones theme ->library-bones.php. Here's a quick manipulation I came up with from the codex that is untested but correct in logic: $args = array( 'paged' => paged, 'posts_per_page' => 5, //-1 shows all 'post_type' => 'page', 'suppress_filters' => true ); $posts = new WP_Query( $args ); if ( $posts -> have_posts()) { <!-- Add the pagination functions here. --> while ( $posts -> have_posts() ) : $posts->the_post(); { //do stuff with the posts returned here } <?php endwhile; ?> <!-- End of the mai

Categories : PHP

Pagination showing same posts from page 1 on all other pages
Do you want it for specific post or for all of them ? If you want general pagination you can make pagination links without plugins with this piece of code : <?php global $wp_query; $big = 999999999; // need an unlikely integer echo paginate_links( array( 'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $wp_query->max_num_pages ) ); ?> Just add it to your index.php or archives.php and see the magic happens :)

Categories : PHP

Wordpress Pagination Not Working - Always Showing First Pages Content
Depending on what page you're on (like a static homepage) WP uses the query var page, not paged. You can correct for that with something like this: if( get_query_var( 'paged' ) ) $my_page = get_query_var( 'paged' ); else { if( get_query_var( 'page' ) ) $my_page = get_query_var( 'page' ); else $my_page = 1; set_query_var( 'paged', $my_page ); $paged = $my_page; }

Categories : Wordpress

One Click Manual Update
Dude, you could really do with providing more information... what is this updater.exe? How does the ClickOnce update overwrite everything in your database? I don't think that you can tell the ClickOnce update functionality to run an executable as part of the update, but you can reference your updater.exe in the Application Files window. Startup Project Properties > Publish Tab > Application Files Button Set your Publish Status column to Include (Auto), Download Group column to (Required) and hash column to Include. Doing this will ensure that the latest version of your updater.exe file is installed to your installation directory. From there, you can access and run your updater.exe file from your ClickOnce application.

Categories : C#

codeigniters pagination is switching pages but does not switch page number
Please take look at this links, http://phpmaster.com/pagination-with-codeigniter/ http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-day-7-pagination/ how to configure pagination codeigniter?

Categories : PHP

apply pagination to search results, limit 10 pages per time
Instead of number starting at 1 let it start at $page and limit it to 10 or til max is reached. $prev = $page - 1; $next = $page + 1; if($prev > 1) echo"<a href='?value=$value'>Start</a> "; if($prev > 0) echo"<a href='?value=$value&page=$prev'>previous</a> "; for($number = 0; $number < 10 && ($number + $page) < $num_pages; $number +=1) { if($number = 1) echo"<b> [$page] </b>"; else echo"<a href='?value=$value&page=" . ($number + $page) . "'> " . ($number + $page) . " </a>"; } if($page < ceil($num_rows/$per_page)) echo"<a href='?value=$value&page=$next'>next</a> "; This way it will always be selected page + 10 unless there are no more pages. Example (if there are on

Categories : PHP

Laravel 4 pagination count
In order to achieve that, you need to initialize the value of counter: <?php $count = (($current_page_number - 1) * $items_per_page) + 1; ?> Notice I'm first subtracting 1 from current page, so the first page number is 0. Then I'm adding 1 to the total result, so your first item starts with 1, instead of 0. Laravel Paginator provides a handy shortcut for that: <?php $count = $players->getFrom() + 1; ?> @foreach ($players as $player) ... There are a few others that you can use as you like: $players->getCurrentPage(); $players->getLastPage(); $players->getPerPage(); $players->getTotal(); $players->getFrom(); $players->getTo();

Categories : PHP

Pagination: 2 Queries(row-count and data) or 1 larger query
Use select count(1) as count... for the total number of rows. Then select data as needed for pagination with limit 0,10 or something like that. Also for total count you don't need to join to the products or categories tables as that would only be used for displaying extra info. "SELECT count(1) as count FROM `productcategories` WHERE catID=$category"; Then for data: "SELECT * FROM `productcategories` JOIN categories ON categories.catID = productcategories.catID JOIN products ON products.proID = productcategories.proID WHERE productcategories.catID=$category limit 0,10"; Replacing * with actual fields needed would be better though.

Categories : PHP

AngularJs pagination on grouping elements
Fixed the code for you. http://jsfiddle.net/93Rd3/ You need to change the order when applying the filters. <div ng-repeat="team in teams| startFrom:(currentPage - 1)*pageSize | limitTo:pageSize "> And you'd better check the text passing into the filter if it is undefined: app.filter('startFrom', function () { return function (input, start) { if (input === undefined || input === null || input.length === 0) return []; start = +start; //parse to int return input.slice(start); } });

Categories : Angularjs

Table pagination with AngularJS and Rails
The will_paginate gem offers a way to paginate queries in Rails controllers and models. From the github README: ## perform a paginated query: @posts = Post.paginate(:page => params[:page]) # or, use an explicit "per page" limit: Post.paginate(:page => params[:page], :per_page => 30) ## render page links in the view: <%= will_paginate @posts %> You can customize the default page contents: # for the Post model class Post self.per_page = 10 end # set per_page globally WillPaginate.per_page = 10 And with Active Record 3 you can do things like: # paginate in Active Record now returns a Relation Post.where(:published => true).paginate(:page => params[:page]).order('id DESC') # the new, shorter page() method Post.page(params[:page]).order('created_at DESC')

Categories : Ruby On Rails

How to implment a "Load more" pagination in Angularjs without ng-repeat?
What exactly are you seeing that makes you want to avoid ngRepeat? I've drafted up a simple example that illustrates what gets redrawn and what doesn't: Example 1: http://jsfiddle.net/langdonx/uf2C9/ If you check the console, you'll see that when you click the add button to add another item to the model, only the newly added item gets rendered. Example 2: http://jsfiddle.net/langdonx/uf2C9/2/ Manipulating every item in the model, still doesn't redraw the entire ngRepeat, it just updates what it needs to. Example 3: http://jsfiddle.net/langdonx/uf2C9/1/ To help illustrate that Example 2 is sound, I added {{item.name}} to the image's src just to make sure it would change (which it does). So what exactly are you trying to avoid?

Categories : Angularjs

AngularJs filtering on grouped elements and pagination
You need to adjust the sequence of the filter. Let's say you want to filter the team, then you need to apply the search filter before the pagination filters. <div ng-repeat="team in teams | filter:searchInput | startFrom:(currentPage - 1)*pageSize | limitTo:pageSize">

Categories : Angularjs

AngularJS filtering causes circular dependency error when using pagination
It turns out that my controller.js had var Home = angular.module("Home", []); In addition to app.js having var Home = angular.module("Home", []); controller.js wiped our my customer filters

Categories : Angularjs

how to make a server side pagination with angularjs $resource ?
Based on the AngularJS $resource documentation, it should be possible to do this: List.query({offset: 0, limit: 100, sortType: 'DESC' }, function(data, responseHeaders) { // you can access headers here });

Categories : Angularjs

Update row that is hidden due to pagination/sorting
Well, the hidden table might not have selectable nodes... but it sure has it's own data! The easiest way is to hold a reference to the two tables: var mySummary = $('#exampleSum').dataTable(); var myTimeline = $('#exampleLine').dataTable(); Now you can always get to the data of each table with myTimeline.fnGetData(). Maybe you need to add an extra invisible data column so you can more easily reference to between the two tables. The fnUpdate() function also works with the indexes from fnGetData(). I'm not sure, but maybe you have to call a myTimeline.fnDraw() right before or after the table becomes visible again to trigger to display the new data.

Categories : Jquery

Update pagination value by onclick with a drop down box and PHP
With jQuery: Include jQuery in the <head> of your page. Something like: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> Add this somewhere below the jQuery library: <script> $(document).ready(function() { $('#pagination').change(function() { $('form').submit(); }); }); </script> You shouldn't need to change the <form>.

Categories : PHP

AngularJs delete record on nested grouped rows with pagination
You are mainly doing 2 things wrong: trying to erase the same index in result as you are in reports erasing in result while there are more items in that row. A possible (working) fix for this will be: $scope.deleteItem = function(item,row){ var lastInRow = true; var index=$scope.reports.indexOf(item); $scope.reports.splice(index,1); //check if any more items match that name (or in the same row) for (var i=0; i<$scope.reports.length; ++i) { if ($scope.reports[i].name == item.name) { lastInRow = false; break; } } $scope.noOfPages = Math.ceil($scope.reports.length / $scope.pageSize); $scope.pages.then(function(result){ //get the relevant index for the result array var resultIndex = result.indexOf(item.name); //if it matches an

Categories : Angularjs

count the number of pages in a docx-document
docx4j doesn't have a page layout model, so it can't tell you a page count. You can get an approximate page count by using FOP's page layout model. docx4j's PDF output now supports a "2 pass" generation: first pass calculates the page count(s) second pass generates the pdf See https://github.com/plutext/docx4j/blob/master/src/main/java/org/docx4j/convert/out/fo/AbstractPlaceholderLookup.java and https://github.com/plutext/docx4j/blob/master/src/main/java/org/docx4j/convert/out/fo/ApacheFORenderer.java So doing the first pass would give you (approximately) what you want. This uses org.apache.fop.apps.FormattingResults which records the number of pages in a page sequence, or in the document as a whole. An alternative approach might be to use LibreOffice/OpenOffice (or Microsoft Word

Categories : Java

Disqus comment count for multiple pages
If you are able to rewrite this as such: var DISQUSWIDGETS; if (typeof DISQUSWIDGETS != 'undefined') { var disqus_options = { "showReactions":true, "text":{ "and":"and", "reactions":{ "zero":"0 Reactions", "multiple":"{num} Reactions", "one":"1 Reaction"}, "comments":{ "zero":"0 Comments", "multiple":"{num} Comments", "one":"1 Comment" } }, "counts":[ {"reactions":0,"uid":1,"comments":2}, {"reactions":0,"uid":2,"comments":5}, {"reactions":0,"uid":3,"comments":9} ] }; DISQUSWIDGETS.displayCount(disqus_options); } Then you will be able to access the count like

Categories : PHP

Update component at change of page on primefaces datagrid with pagination
Finally, instead of <p:dataGrid ... /> i used <p:dataTable ... /> with <p:ajax ... /> inside, this is my code: <p:dataTable var="myVar" paginator="true" rows="1" value="#{myBean.listOfObjects}"> <p:ajax event="page" update="buttons" listener="#{myBean.update}" /> ... ... </p:dataTable> And update method: public void update(PageEvent event) { int var = event.getPage(); ... (update components values of dataTable and buttons using var) ... }

Categories : Ajax

If i am having the 5 pages with 5 controllers in angularjs
All Angular services are application singletons. This means, you can change state of the service once, and the change will be 'visible' to all it's users. The service gets instantiated when application will ask for it. While the service exists, all the controllers, etc. will receive a reference to the same service instance (I would still expect the service to be garbage collected when all the references to the service are lost). This means, after you initialize the service, all controllers can invoke methods, etc. - all on the same instance, visible to all other instances. Here's a jsFiddle showing the concept. When the value in factory object is changed in one controller, it is visible throughout the application. Both controllers use the modified value of testFactory.name, as it gets m

Categories : Angularjs

AngularJS template bindings don't update on data change, but do update when I read the model
AngularJS only updates bound variables during a scope digest cycle; this normally happens automatically for Angular managed events (ng-click, etc.), but in asynchronous code, such as a setTimeout, you must manually call Scope#$apply() or Scope#$digest(): $window.setTimeout(function(){ $scope.$apply(function() { $scope.wiglets[0].isActive = true; console.log("Wiglet 1 isActive:", $scope.wiglets[0].isActive); }); }, 2000); This is so common with setTimeout that AngularJS has a built in service, called $timeout, that does this for you: $timeout(function(){ $scope.wiglets[0].isActive = true; console.log("Wiglet 1 isActive:", $scope.wiglets[0].isActive); }, 2000); Example: http://plnkr.co/edit/XDK06uhYMNcI6fs6SuHP?p=preview

Categories : Angularjs

How to upload my AngularJS static site to Github Pages?
There is a deployment guide on Yeoman's site for how to deploy to the gh-pages branch using git subtree. From the guide... When you run grunt build, it generates a completely optimized version of your application in a dist directory that can be deployed. The recommended way of deploying the dist directory is using git subtree. Remove the dist directory from the .gitignore file. Add the dist directory to your repository and commit it with your project. git add dist && git commit -m "Initial dist subtree commit" Once the dist directory is part of your project we can use git subtree to set up a separate repository on a different branch. Note: prefix must be the relative path to your dist directory. This is assuming dist is in your root directory. git subtree push --prefix dist

Categories : Angularjs

One form to update multiple pages in Rails
You can't render two pages at once, a user can only see one page at a time. But you can create one page that displays the results with some clever coding. If you have two models, say Model1 and Model2, and a view for each one, say model1/show.html.erb, you can change the show.html.erb code from: <%= @model.name %> etc... to <%= render 'display' %> Create a file named _display.html.erb, and put the contents from show.html.erb in there. Now, when you visit the show page for Model1, it will call the display partial and render all the information accordingly. Lather, rinse, repeat for Model2. So, your return page for your dual form would also utilize this very same partial. The results page for your form would look like: <%= render 'model1/display' %> <%= ren

Categories : Ruby On Rails

AngularJS : Directive : Animate sliding pages and postpone controller binding
First of all, some minimal changes to get what you have working. You need to prevent the default event from navigating the page (that's why it changes before the navigation completes), and you need to do the navigation manually after the first animation has finished. So one way is to pass the event and url into slidePage: <div id="wrapper" ng-app="myApp"> <div page-animate> <p> <a class="btn btn-primary" ng-click="slidePage($event, '/')">Home</a> <a class="btn btn-info" ng-click="slidePage($event, '/users')">Users</a> <a class="btn btn-success" ng-click="slidePage($event, '#/pages')">Pages</a> </p> <div id="relativeContainer"> <div id="content"

Categories : Jquery

I try to deploy my Yeoman AngularJS static site to Github pages but the git subtree command always gets rejected
I had the same problem. The problem was that I had dist already committed in the current repo. No as a subtree. The following steps should resolve the issue // remove the dist and commit rd /s dist git commit -am "remove dist folder" // add the subtree and push git subtree add --prefix dist origin gh-pages git subtree push --prefix dist origin gh-pages That seemed to do the trick for me

Categories : Angularjs

Convert mysqli pagination to prepared statement pagination
Try and put the error reporting and see if you have error on mysqli statements: $stmt=$myConnection->prepare('SELECT id FROM products'); // due to syntax error or other reasons may be like privileges prepare can fail so if ( false===$stmt ) { // hope you will use better than die to handle but here's only example. die('prepare() failed: ' . htmlspecialchars($myConnection->error)); } $ExecuteStmt = $stmt->execute(); // execute() can also fail for various reasons. if ( false===$ExecuteStmt ) { //again same thing about die(); die('execute() failed: ' . htmlspecialchars($myConnection->error)); } $myConnection->close(); Hope this helps.

Categories : PHP

Count & print the checked inputs with AngularJS
JS: var app = angular.module('plunker', []); app.controller('MainCtrl', function($scope) { $scope.lists = [ {'id':'1', 'name':'list 1', checked: true}, {'id':'2', 'name':'list 2'}, {'id':'3', 'name':'Macbook Pro'}, {'id':'4', 'name':'Dell Optiplex 755'}, {'id':'5', 'name':'Google Nexus S'} ]; $scope.$watch('lists', function(lists){ $scope.count = 0; angular.forEach(lists, function(list){ if(list.checked){ $scope.count += 1; } }) }, true); }); VIEW: <body ng-controller="MainCtrl"> <ul style="padding:10px;"> <input type="text" ng-model="fil.name" /> <li ng-repeat="list in lists | filter:fil"> <div style="margin-bottom:0;" class="checkbox"> <label> <in

Categories : Javascript

AngularJs count filtered items in ngrepeat
Your problem is in the expression <div ng-repeat="group in filtered = (groups)|startFrom:(currentPage-1)*pageSize|limitTo:pageSize"> You should take the filtered = out like this <div ng-repeat="group in (groups)|startFrom:(currentPage-1)*pageSize|limitTo:pageSize"> Also because angular doesn't have access to Math you should apply it to your scope like so. $scope.Math = window.Math;

Categories : Angularjs

how to remove pagination after the datatable is rendered with pagination
You have to make use of fnLengthChange as detailed on the API: http://datatables.net/plug-ins/api#fnLengthChange For example: $(document).ready(function() { var oTable = $('#example').dataTable(); oTable.fnLengthChange( 10000 ); //big limit to show All } );

Categories : Jquery

SQL update with count gets only nulls
Not certain, but first guess is that count is a reserved word... change it to something else such as... update r set r.Race = d2.Race, r.RaceNum = d2.cnt from @results r inner join (select d.Race, COUNT(d.race) as 'cnt' from #Demographic d group by d.Race)d2 on r.Race = d2.Race or alternatively try delimiting the column identifier as [count] or if you have quoted identifiers on "count"

Categories : SQL

case update, two tables and count
You try to distinguish based on a m.event, and the result is a grouped value (count(m.id)). I think you should sum 0 or 1 based on your value. update l set l.request = (select sum(if m.event = "rRequested", 0, 1) from m where m.id = l.id)) See MySQL Update query with left join and group by for the topic. EDIT: The question's focus seems to be avoiding the full subselect. I think since there are no real restrictions on l that the database has to go through all lines of m with event="rRequested". So I could imagine going once through m grouping by l.id: update l inner join ( select id, count(*) as cnt from m where m.event = "rRequested" group by id ) as grp_m on grp_m.id = l.id set l.request = grp_m.cnt ; It sounds a bit strange that table m has many entries wi

Categories : Mysql

Best way to update view count in PHP/MySQL
If I were you I would make a new table for views and insert a new record on each view and when was it viewed, then I would select all the views that are dated today and count them and that would give me the number of times the article was viewed today and it would still keep the total count

Categories : PHP

update in nested sql with count match
The IN clause must only return one column: where StringField_1 in (select StringField_1 from my.table group by StringField_1, StringField_2, StringField_3 having COUNT(*) > 10 and StringField_3 LIKE '.*some_string_here.*');

Categories : SQL

Count and performs an insert or an update
Assumine userID has a unique index: INSERT INTO Votes (userID, value) VALUES (:id, :value) ON DUPLICATE KEY UPDATE value = VALUES(value); Also, since you're using PDO, you should be using placeholders in the prepared statement, not interpolating variables, as I showed above.

Categories : Mysql

Update view count, most reliable way
If, lets say 400, people at the exact same time open a topic, the MySQL database apparently would count all the views because this is exactly what databases were invented for. All the approaches for a viewcounter that you have found are wrong. To update a field you don't need to retrieve it, but just already update: UPDATE forum SET views + 1 WHERE id = ?

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.