w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Magento - Hide link in main menu for logged in users
So to detect if you are logged in, you can call this function: $this->helper(‘customer’)->isLoggedIn() Where you have your code displaying the the login and place it in an if condition if($this->helper(‘customer’)->isLoggedIn()){ //your shop code here. } else { //keep login code here. }

Categories : Magento

Hide specific posts from category list in wordpress
Try this: Apply Custom Fields Parameters in get_post query itself. $posts = get_posts(array( 'posts_per_page' => 10, 'post_type' => '<YOUR_POST_TYP>', 'meta_key' => 'taken_check', 'meta_value' => '<DEFAULT_VALUE_OF_taken_check>' )); Lots to read here: http://codex.wordpress.org/Template_Tags/get_posts

Categories : PHP

How to make Wordpress Category menu items display the category as title?
You can look at the category slug in the URL, and get the category by its slug. $cat = get_category_by_slug( $slug ); echo $cat->name; http://codex.wordpress.org/Function_Reference/get_category_by_slug

Categories : Wordpress

Show Wordpress Category Based on Category Name's Content
I think, you may try this global $wpdb; $query = SELECT GROUP_CONCAT( wp_terms.term_id ) AS IDS FROM wp_term_relationships LEFT JOIN wp_term_taxonomy ON ( wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id ) LEFT JOIN wp_terms ON wp_term_taxonomy.term_taxonomy_id = wp_terms.term_id WHERE wp_term_taxonomy.taxonomy = 'category' AND wp_terms.name LIKE '*%' $ids = $wpdb->get_var($query); wp_list_categories("include=$ids");

Categories : Wordpress

How to enable 2 logged in users to my app?
You can store the company id in the url, so in the one tab you have /edit/company/1 and in the ohter /edit/company/2 Then you can let them choose either one of the companies, and make sure that id is at every url. Make sure that the correct permissions are set though, if you maintain a lot of users/companies.

Categories : PHP

Users not logged in since new year
Ok, the last login is stored as Unix time time so you need to convert the time at 31-12-2012 to Unix time for the comparison. The Unix time includes milliseconds in this case so you also need to multiply by 1000 or add 999 to the end e.g. Attribute_value < '1357019999999' Or attribute_value < DATEDIFF(ms,'19700101 00:00:00:000','20121231 23:59:59:999') You can put in whichever time stamp you like and it should be able to compare the two nvarchars correctly.

Categories : Sql Server

Query in SqlServer for Users Currently logged in
SELECT * FROM tblData E WHERE E.date = convert(date, getdate()) and convert(time, E.time) <= convert(time, getdate()) and E.type = 'IN' not exists( select 'x' from tblData U where U.id = E.id and U.type = 'OUT' and E.date = U.date and U.time > E.time and convert(time, U.time) <= convert(time, getdate()))

Categories : Sql Server

Possible to have multiple git users logged in as root?
It would be safer to manage that kind of access control with an authorization layer like gitolite, instead of relying on system account. That way, you are controlling who can pull what. Although that wouldn't control the "where" part (where the users would pull those repos to)

Categories : Linux

Wordpress: when I click on a post, in a category, it loads the category, instead of the post content
When you click on a post ("Wedding Test" or "Long's Wedding Gallery") it takes you to that post. Wordpress by default when you add a post it creates a link after your website (for example http://YOURWEBSITE.com/YOUR-POST/) - If you want it to go to http://YOURWEBSITE.com/YOUR_CATEGORY/YOUR-POST/ you will have to set up custom taxonomies

Categories : Wordpress

hiding links from users who are not logged on php/mysql
When you are logged in I hope you are setting SESSION. If you are setting a session when you logged is $_SESSION['id'] = "SOME VALUE" then you have to do like this:- if(isset($_SESSION['id'])) { echo '&raquo; <a href="logout.php">Logout</a> &raquo; <a href="creation.php">Creation</a>'; } The above code explanation :- When you click on logout link you have to destroy your session. So when the user is not logged in then it will not get any session, so you have to put a condition if the session is set then only show those link other wise don't show it

Categories : PHP

Get current logged in Windows Users privilliges
Below snippet is working for me in Windows7. Can you please try it out. Thanks public static bool IsAdminUser() { bool isAdmin = false; AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal); WindowsPrincipal principal = (WindowsPrincipal)System.Threading.Thread.CurrentPrincipal; WindowsIdentity identity = (WindowsIdentity)principal.Identity; isAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator); return isAdmin; }

Categories : Windows

Show users a message before they are logged out by timeout
It looks like as of when I wrote this answer, there weren't any gems or Devise hooks to take care of this for me, so I had to roll out my own component. One of the most difficult parts of writing the component was figuring out how to send a request to the server to check how much longer the user had before being automatically logged out. I didn't want sending that request to reset the auto-log-out "timer." This question explains how I dealt with that task: Devise - Make a request without resetting the countdown until a user is logged out due to inactivity

Categories : Ruby On Rails

Create new users with the same group(s) as the user logged in
there are several way you could do this... I'd recommend adding the groups once validation for the other fields has taken place, and the user object has been saved; so you can override the save() function of the form and add them there: <?php class YourUserForm extends PluginsfGuardUserForm { /** * A class variable to store the current user * @var sfGuardUser */ protected $current_user; public function configure() { // Remove all widgets we don't want to show unset( $this['is_super_admin'], $this['updated_at'], $this['groups_list'], $this['permissions_list'], $this['last_login'], $this['created_at'], $this['salt'], $this['algorithm'] ); // save the currrent user for use later in the save function $t

Categories : Symfony2

how to integrate wordpress users with vbulletin users
You can give a try to obscureclouddon's mod, as an alternative to vbSSO. (an other link here) It seems to be a good choice, since it has features you need : WordPress->vB features: *Registration sync – new users created on WP are automatically created on vB vBulletin ->Wordpress features NEW *Registration sync – new users created on vB are automatically created on WP The bad things are : this modification is in beta stage free version has limited features, the pro version is, IMHO, expensive... (but it could worth the cost..)

Categories : PHP

Make folder only accessible for logged-in users on IIS7
In web applications I have worked on, we stream the PDF files to the browser. This way no one has direct access to the file's URL and since it is an ASPX page, we can apply whatever securtiy we want (ie. user must be logged in). Here is sample code similar to what I used: Dim strFilePath As String = "C:wwwpdfabc.pdf" Using fs As New System.IO.FileStream(strFilePath, System.IO.FileMode.Open) Dim docStream(fs.Length) As Byte fs.Read(docStream, 0, CInt(fs.Length)) Response.ClearContent() Response.ContentType = "application/pdf" Response.AddHeader("Content-Disposition", "inline; filename=" + System.IO.Path.GetFileName(strFilePath)) Response.AddHeader("Content-Length", fs.Length) Response.BinaryWrite(docStream) Response.

Categories : Vb.Net

Get and list users based on idempresa of logged in user
It's generally not good practice to use sfContext::getInstance(). Read this post http://webmozarts.com/2009/07/01/why-sfcontextgetinstance-is-bad/. How about adding a static method to your sfGuardUserTable.class.php, e.g // libformsfGuardUserTable.class.php static public function getUsersByIdEmpresa($idempresa) { //... $q->andWhere('idempressa = ?', $idempresa); return $q->execute(); } Then calling it in your controller or from where you need, e.g // appmyAppmodulesmyModuleactionsaction.class.php public function executeMyAction() { $profile = $this->getUser()->getProfile(); $usersRelatedByIdempresa = sfGuardUserTable::getUsersByIdempresa($profile->getIdempresa()); //... }

Categories : Symfony2

Getting logged in users with sessionRegistry not work when manually authenticate
In your Spring spring-security.xml file, the URL for the AJAX authentication (/ajaxLogin) is not explicitly allowed. Thus the request should be blocked by Spring. I would suggest to add this: <intercept-url pattern="/ajaxLogin" access="permitAll" />

Categories : Ajax

Removing the logged in user's name from the list of users in django
Can you try something like that ? {% for likes in forum.likes.all %} {% if user != likes.user %} <li><a href="/get/{{likes.user}}">{{likes.get_full_name}}</a></li> {% endif %} {% endfor %}

Categories : Django

Backbone Model fetch without id (for showing logged in users details)
Since the url will be the same for each current user instance, try using this definition: var CurrentUser = Backbone.Model.extend({url: '/api/currentuser' }); url will simply return the provided string, whereas urlRoot will attempt to generate the proper full url with the user id. Then, you should be able to have: var currentuser = new CurrentUser(); currentUser.fetch(); var currentuser_view = new CurrentUserView({ collection: currentUser }); Of course, you need to make sure the user information has been fetched from the server before rendering the view, or you'll get the "name is not defined" error. You can see how to synchronize your code so the view waits for the data before rendering in this blog post: http://davidsulc.com/blog/2013/04/01/using-jquery-promises-to-render-ba

Categories : Backbone Js

how to allow users logged in to UPDATE / EDIT their profile settings/information
short version ;) HTML file: <form action="./change.php" method="post"> Nickname: <input type="text" name="nickname"><br /> Country: <input type="text" name="country"><br /> Date of birth: <input type="text" name="date_of_birth"><br /> Gender: <input type="text" name="gender"><br /> Motto: <input type="text" name="motto"><br /> Bio: <input type="text" name="bio"><br /> <input type="submit" value="Submit"> </form> change.php: <?php function filter($date) { return trim(htmlspecialchars($date)); } $nickname = filter($_POST['nickname']) $country = filter($_POST['country']) $date_of_birth = filter($_POST['date_of_birth']) $gender = fi

Categories : PHP

Hide the FB Login button if user already logged in
Try instead using display: none for the #fb-login element. visibility: collapse is for table elements; should act like visibility hidden, that is, reserve space for the invisible button. visibility: collapse also doesn't work for IE8 at all.

Categories : Javascript

Show/hide sitemap if user is logged in
if (reader.HasRows) { reader.Read(); // set as user authenticated FormsAuthentication.SetAuthCookie(txtuser.Text, true); MessageBox("Login Successful"); clear(); } In your PageLoad protected void Page_Load(object sender, EventArgs e) { if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated) { Menu1.Visible = false; NavigationMenu.Visible = true; } else { Menu1.Visible = true; NavigationMenu.Visible = false; } } OR protected void Page_Load(object sender, EventArgs e) { bool isAuthenticated = System.Web.HttpContext.Current.User.Identity.IsAuthenticated; Menu1.Visible = !isAuthenticated; NavigationMenu.Visible =isAuthenticated; }

Categories : C#

PHP and jQuery: show/hide div if user logged in or not
Edit: <div id="loginbutton"></div> <div id="menu"> <ul> <li></li> <li></li> <li></li> </ul> </div> <?php if (isset($_SESSION['id']) && !empty($_SESSION['id'])){ ?> <script> document.getElementById("loginbutton").style.display = "none"; document.getElementById("menu").style.display = "show"; </script> <?php } else { ?> <script> document.getElementById("menu").style.display = "none"; document.getElementById("loginbutton").style.display = "show"; </script> <?php } ?> </div> this should work

Categories : PHP

Best Practice for separating Meteor app into 2 sections, one for a landing and the actual app for users logged in
I don't think the two instances approach is a very good idea. The flow you describe above could be achieved by simply using templates, where you render one part if the user is logged in and another part if the user isn't logged in: <body> {{#if currentUser}} {{> userIsLoggedInTemplate}} {{else}} {{> userIsNotLoggedInTemplate}} {{/ if}} </body> The {{#if currentUser}} is described here: http://docs.meteor.com/#template_currentuser For inspiration take a look at the examples that are provided on the meteor homepage. Another approach you could choose to follow could be to add a Router - more info here (net.tutsplus.com)

Categories : Javascript

How to tell when a user is logged in with Yii, in Wordpress
All you have to do is include the wp-load.php file in the index.php of Yii and after that, you will be able to use all the wordpress functions, including is_user_logged_in(). and also check this link http://codex.wordpress.org/Function_Reference/ hope it will help you.Thank you.

Categories : Wordpress

Unable to hide login button after logged in using jQuery and PHP
You need to show the buttons as you have hidden them while login. You need to change the code like this. $(document).ready(function(){ x = $(".message").text().trim(); if ( !!x) { $(".login").hide(); $("#logout").show(); } else { $("#logout").hide(); $(".login").show(); } });

Categories : PHP

hide or show objects depending on user logged in
This is quite easy. Since you already know whether they are logged in on every page, you can simply check for them in the HTML of the page. The simple idea is below: <html> <head></head> <body> <?php if ($_SESSION['userName'] == 'whateverTheNameShouldBe') : ?> <span>Edit</span> <?php endif; ?> </body> </html> What I would do though is add a key to $_SESSION which indicates whether the user is an admin or not. $_SESSION['isAdmin'] which can be a true/false boolean. Then you can do something like this: <html> <head></head> <body> <?php if ($_SESSION['isAdmin']) : ?> <span>Edit</span> <?php endif; ?> </b

Categories : PHP

How do i only allow users that created a category to edit it in rails
Assuming you have 2 join tables: user.rb has_many :categories, :through => :user_categories category.rb has_many :users, :through => :user_categories has_many :bookmarks, :through => :bookmark_categories def is_editable_by?(user) user.category.include? self end bookmark.rb has_many :categories, :through => :bookmark_categories has_many :users, :through => :categories your_view.html.erb if category.is_editable_by? current_user <%= link_to "edit", edit_category_path, category %> end

Categories : Ruby On Rails

Wordpress removing p tags when not logged in
Use this useful Pluggin After Installation: Settings > TinyMCE Advanced > check the Stop removing the P tag ..... Now, WordPress will not remove any paragraph tag.Hope this will help you

Categories : PHP

Facebook ignores timezone info for non-logged in users on uploaded events with ISO-8601 datetime
Have you enabled time zone support in the Facebook app settings? You can read about this more here.

Categories : Facebook

Redirect to front page wordpress if not logged in
I tried with the action hook init but the current post/page information is not available yet. But then, template_redirect does the job and it only acts on the front-end, login and admin pages work normally. Here, there's a page with the slug welcome, to check for a post use is_single('post-slug'): add_action( 'template_redirect', 'redirect_so_18688269' ); function redirect_so_18688269() { if( !is_user_logged_in() && !is_page( 'welcome' ) ) { wp_redirect( site_url( 'welcome' ) ); exit(); } }

Categories : PHP

Load a different stylesheet in WordPress if an admin is logged in
I never used WP but if you can edit the code you could do a simple query if the admin is logged in and then use some inline-code <div class="example" <?php if($admin == 1){ echo 'style="display: block;"';} else{ echo 'style="display: none;"'; ?>> CONTENT </div>

Categories : PHP

Hide Numbers when category is null
I'm not 100% sure of what you are asking for. But, to turn off the XAxis or yAxis labels, juse labels : {enabled:false} and to change the tooltips use tooltip:{formatter: function() {...}} see this fiddle: http://jsfiddle.net/6ypq4/ xAxis: { title: { text: null }, labels : { enabled: false } }, yAxis: { min: 0, title: { text: 'Population (millions)', align: 'high' }, labels: { overflow: 'justify', enabled: false } }, tooltip: { formatter: function() { return this.y + ' millions'; } },

Categories : Javascript

Wordpress: different single post template if subscriber is logged in
Are you comfortable with PHP? What you'd have to do is find the template directory and edit (or create) single.php and use get_template_part to display the correct single.php template: <?php get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php while ( have_posts() ) : the_post(); ?> <?php if ( is_user_logged_in() ) : <?php get_template_part( 'single' ); ?> <?php else: ?> <?php get_template_part( 'single', 'guest' ); ?> <?php endif; ?> <?php // If comments are open or we have at least one comment, load up the comment template if ( commen

Categories : Wordpress

Get category id in wordpress
It depends on what you want to do, but can you try this? echo get_cat_ID('services'); See http://codex.wordpress.org/Function_Reference/get_cat_ID

Categories : Wordpress

How to rewrite wordpress category url
Just use the buit-in Rewrite API of wordpress : http://codex.wordpress.org/Rewrite_API Example : http://www.hongkiat.com/blog/wordpress-url-rewrite/

Categories : Wordpress

Wordpress query_posts by tag OR category
What about this to fetch data twice once for category and then for tag $posttags = get_the_tags(); $tags = ''; if ($posttags) { foreach($posttags as $tag) { $tags .= ','.$tag->name; } } $taglist = substr($tags, 1); $category = get_the_category(); $tagposts = query_posts('&tag='.$taglist.'&orderby=date&order=DESC&posts_per_page=3'); $categoryposts= query_posts('&orderby=date&order=DESC&posts_per_page=3&cat='.$category[0]->term_id); $post=array_merge($tagposts,$categoryposts); Then you can use some sort of array_unique if have duplicates

Categories : Wordpress

Two different category boxes in WordPress
You want to add custom taxonomies I think. You can do that either by: a plugin called More Taxonomies or by generating a new taxonomy in functions.php or create a plugin with the new taxonomy code

Categories : Wordpress

How do I use different category template in wordpress?
You can check category by id and use native function where it needed. get_template_part( 'custom_category', 'category' ); Also You can try something from here Wordpress Codex

Categories : Wordpress

how to get parent category id in wordpress
Here is the function: <?php get_category_parents($cat); ?> This function accepts several arguments, you can find the full reference on wordpress codex

Categories : PHP



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