Forum Replies Created

Viewing 15 replies - 1 through 15 (of 17 total)
  • Hey,

    When i have those kind of errors i usually that i messed up the code. Check to see that the code in functions ends with ?> And also, if you have any empty lines below the ?> remove them!

    About thematic, I have used both and i have to say that thematic is ways better. You find everything you need in the forums and if you build a lot of web with thematic you can reuse the code so that you hardly have to write anything. Of course you can do this with Genesis. But Thematic is free and free is cool.

    Thread Starter dynamitharry

    (@dynamitharry)

    Ok, since i don’t get any responses here i have made my own solution that i gladly share.

    First thing, i’m using Thematic with a child theme, and the plugin Magic Fields. But i guess that does not matter.

    I have created two page templates. One called login and one called logged in page.

    The login page is the page where i login. It goes a bit backwards but but i take it from top to bottom anyway.

    <?php
    /**
     * Template Name: Custom Login Page
     *
     */
     //get the url from the current user
     	global $current_user;
          get_currentuserinfo();
          $address = $current_user->user_url;
          //when the page relodes direct the user to the user url address..
     if ( is_user_logged_in() ) { header( 'Location:' . $address ) ; } 
    
    wp_login_form();

    When you visits it and is not logged in, you will see the form. when you log in and the page reloads you will get directed to the your user url.

    Then to the “logged in page”, you have to create this. Set a custom field to have the same value as the user name. Then the code goes like this:

    //Check if the user is logged in
    	   global $current_user;
          get_currentuserinfo();
          //get the current username of the logged in user.
          $username = $current_user->user_login;
          // get the custom value user name of the page
    		 $user = get('restricted_to_user');
    		 //check if the username for the page and the username is the same. And always let the admin see the page..
     if (($username == $user) || (current_user_can('manage_options'))) {

    then go on the way you want with the page and in the end of the page:

    <?php } else {
    
       header( 'Location: https://localhost:8888/?page_id=XXX' ) ;
    }
    ?>

    so that if you are not logged in you get directed to the login page.

    This is quite manual, but still, i don’t have to mess with plugins, roles and stuff. It feels great.

    If anyone have any doubts about this regarding security, searchbots or anything please tell me, because i don’t know much about it..

    Thread Starter dynamitharry

    (@dynamitharry)

    I made some tests with custom fields. I set a name in a custom field in the page, the name of the user who should be able to see the page. Then i compare this with the logged in user and also i make so the admin always can see the page.

    Someone that has any thoughts about this and security. Is it a safe way of doing it?

    <?php global $current_user;
          get_currentuserinfo();
          $username = $current_user->user_login;
    		 $user = get('user_for_page');
     if (($username == $user) || (current_user_can('manage_options'))) { ?>
    Thread Starter dynamitharry

    (@dynamitharry)

    Thanks!

    Hey!

    I’m also after the same thing! Did you do it?

    Forum: Fixing WordPress
    In reply to: Gd library
    Thread Starter dynamitharry

    (@dynamitharry)

    that is perfectly the answer to my questions! thanx!

    Thread Starter dynamitharry

    (@dynamitharry)

    it works when i change in reading settings to only show one post, but that messes up my other category posts.. disturbing!

    Thread Starter dynamitharry

    (@dynamitharry)

    i tried the code, it works to show only one post from category 9, but the navigation don’t work. is it something that is missing in my code?

    <?php
    /**
     * Template: Category.php
     *
     * @package WPFramework
     * @subpackage Template
     */
    
    get_header();
    ?>
    
    			<!--BEGIN #primary-->
    			<div id="primary" class="hfeed" >
    
    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('cat=9&posts_per_page=1&paged=' . $paged);
    ?>
    
                <?php if ( have_posts() ) : ?>
    
                    <h1 class="page-title archive-title">Category Archives: <span id="category-title"><?php single_cat_title(); ?></span></h1>
    <?php while ( have_posts() ) : the_post();  ?>
    
    				<div id="post-<?php the_ID(); ?>" class="<?php semantic_entries(); ?>">
    					<h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    
    					<!--BEGIN .entry-meta .entry-header-->
    					<div class="entry-meta entry-header">
    						<span class="author vcard">Written by <?php printf( '<a class="url fn" href="' . get_author_posts_url( $authordata->ID, $authordata->user_nicename ) . '" title="' . sprintf( 'View all posts by %s', $authordata->display_name ) . '">' . get_the_author() . '</a>' ) ?></span>
    						<span class="published">on <abbr class="published-time" title="<?php the_time( get_option('date_format') .' - '. get_option('time_format') ); ?>"><?php the_time( get_option('date_format') ); ?></abbr></span>
    						<span class="meta-sep">&mdash;</span>
    						<span class="comment-count"><a href="<?php comments_link(); ?>"><?php comments_number( 'Leave a Comment', '1 Comment', '% Comments' ); ?></a></span>
    						<?php edit_post_link( 'edit', '<span class="edit-post">[', ']</span>' ); ?>
    					<!--END .entry-meta .entry-header-->
                        </div>
    
    					<!--BEGIN .entry-summary .article-->
    					<div class="entry-summary article">
    						<?php the_excerpt(); ?>
    					<!--END .entry-summary .article-->
    					</div>
    
    					<!--BEGIN .entry-meta .entry-footer-->
                        <div class="entry-meta entry-footer">
                        	<?php if ( framework_get_terms( 'cats' ) ) { ?>
                            <span class="entry-categories">Also posted in <?php echo framework_get_terms( 'cats' ); ?></span>
    						<?php } ?>
    						<?php if ( framework_get_terms( 'tags' ) ) { ?>
                            <?php if ( framework_get_terms( 'tags' ) and framework_get_terms( 'cats' ) ) { ?>
                            <span class="meta-sep">|</span>
    						<?php } ?>
                            <span class="entry-tags">Tagged <?php echo framework_get_terms( 'tags' ); ?></span>
                            <?php } ?>
    					<!--END .entry-meta .entry-footer-->
                        </div>
    				<!--END .hentry-->
    				</div>
    
    					 </li>
              </ul>
    
    				<?php endwhile;  ?>
    				<?php include ( TEMPLATEPATH . '/navigation.php' ); ?>
    				<?php else : ?>
    
    				<!--BEGIN #post-0-->
    				<div id="post-0" class="<?php semantic_entries(); ?>">
    					<h2 class="entry-title">Not Found</h2>
    
    					<!--BEGIN .entry-content-->
    					<div class="entry-content">
    						<p>Sorry, but you are looking for something that isn't here.</p>
    						<?php get_search_form(); ?>
    					<!--END .entry-content-->
    					</div>
    				<!--END #post-0-->
    				</div>
    
    			<?php endif; ?>
    			<!--END #primary .hfeed-->
    			</div>
    
    <?php if (in_category(array(8, 18, 19, 20, 22, 9, 10, 11, 12))) { get_sidebar(); } else {} ?>
    
    <?php get_footer(); ?>

    Thread Starter dynamitharry

    (@dynamitharry)

    Thanks!

    But i dont think it works for me..

    I list a lot of attachments from several post in my category.php.. every post got at least three attachments.. now when i put it in i just get the same attachment id on everything.

    the reason why i need unique id’s is because i use quicksand to filter my attachments..

    Thread Starter dynamitharry

    (@dynamitharry)

    Was a bit too fast!

    Found the solution here:

    Bruno!

    Could you explain a little bit more how you did this?

    Can’t get it right..

    Thread Starter dynamitharry

    (@dynamitharry)

    thank you very much!

    dynamitharry

    (@dynamitharry)

    Well, i found one solution. Maybe not the best but i keep it in wordpress..

    First i installed the plugin “Members”. Then i made it possible for everyone to sign up to the blog. When they signed up i choosed in the members plugin that new people are pending with no access to special pages.

    In my case there are different companys that will sign up so that they can write requests and order different stuff. So i created a page that i called login and that every company can see when logged in. I defined the settings in members. At the page wich every logged in user can see, a created a list of companys, and there respective pages. And in member changed the access to them so that the right person got access to them.

    This is one way of doing it. It’s a bit manual (or very) but it works for me.

    try it out!

    Thread Starter dynamitharry

    (@dynamitharry)

    Cool, i’m gonna check it out!

    Thread Starter dynamitharry

    (@dynamitharry)

    Thank you very much for the answer!

    But i don’t get it to work. Do you use the FormBuilder plugin?

    Where should i put this code? I try to put it in the value field. but it does not seems right to put this there, all i get in the e-mail that is sent to me is the whole code.

    Can i put this in the page and then call something in the value field?

    thank you!

Viewing 15 replies - 1 through 15 (of 17 total)