Welcome to geekForum.com! Log in or Sign up to interact with the community.

Tutorial Anyone?

Discussion in 'Coding Forum' started by The Craw, Oct 31, 2011.

  1. The Craw Member

    Member Since:
    Oct 29, 2011
    I think site is pretty cool, and I'd like to see it grow. From my experience, one of the best ways to have a successful site is to have interesting content. So, with that said, does anyone want to suggest a tutorial for me to write? Preferably in PHP, JavaScript, jQuery, CSS, or XHTML. If you would like to suggest something, please narrow it down a little bit, as I don't have time write a book on how to make your own blog. :p
  2. Dukie New Member

    Member Since:
    Jun 13, 2011
    [quote author=The Craw link=topic=190.msg850#msg850 date=1320093860]
    I think site is pretty cool, and I'd like to see it grow. From my experience, one of the best ways to have a successful site is to have interesting content. So, with that said, does anyone want to suggest a tutorial for me to write? Preferably in PHP, JavaScript, jQuery, CSS, or XHTML. If you would like to suggest something, please narrow it down a little bit, as I don't have time write a book on how to make your own blog. :p
    [/quote]

    How about PHP?

    Like how to write a simple modification for perhaps SMF? or an intro to PHP?
  3. The Craw Member

    Member Since:
    Oct 29, 2011
    Okay, I'll do something on data types and how to manipulate them in PHP.
  4. Dukie New Member

    Member Since:
    Jun 13, 2011
    [quote author=The Craw link=topic=190.msg852#msg852 date=1320112989]
    Okay, I'll do something on data types and how to manipulate them in PHP.
    [/quote]

    Sounds good :) Can't wait to read it!
  5. Clara Listensprechen Member

    Member Since:
    Jul 14, 2011
    Chiming in to say that I could use vocabulary and syntax work, bigtime. I've modified SMF code but that doesn't mean I'm literate. I'd sure like to learn how to write.
  6. The Craw Member

    Member Since:
    Oct 29, 2011
    [quote author=Clara Listensprechen link=topic=190.msg855#msg855 date=1320206232]
    Chiming in to say that I could use vocabulary and syntax work, bigtime. I've modified SMF code but that doesn't mean I'm literate. I'd sure like to learn how to write.
    [/quote]

    Well if you have any specific questions, you can post in this board, and I'll do my best to help you out.
  7. Clara Listensprechen Member

    Member Since:
    Jul 14, 2011
    Ya, I've been tackling a thing where the php works with a css and I'm trying to figure out the right syntax to have the php override one part of the css which defines how all links are displayed. There's just a handful of links I want displayed in a different way than the rest, and I'm not sure about how to go about it exactly (or if it's even doable. I would think it could be done).

    It's the area where the forum posts its greeting to username, you have messagelink, 1 is new, Show unread since your last visit, Show unreadreplies to your posts. The css demands that all links be all one color unvisited (nevermind hover or visited color for now) so if you have a dark header and need light colored links, then making all light colored links makes links unreadable in a light body area. And so I've been trying to make the php override the css only on those specific Userarea links in the header.

    Help?
  8. The Craw Member

    Member Since:
    Oct 29, 2011
    [quote author=Clara Listensprechen link=topic=190.msg862#msg862 date=1320294471]
    Ya, I've been tackling a thing where the php works with a css and I'm trying to figure out the right syntax to have the php override one part of the css which defines how all links are displayed. There's just a handful of links I want displayed in a different way than the rest, and I'm not sure about how to go about it exactly (or if it's even doable. I would think it could be done).

    It's the area where the forum posts its greeting to username, you have messagelink, 1 is new, Show unread since your last visit, Show unreadreplies to your posts. The css demands that all links be all one color unvisited (nevermind hover or visited color for now) so if you have a dark header and need light colored links, then making all light colored links makes links unreadable in a light body area. And so I've been trying to make the php override the css only on those specific Userarea links in the header.

    Help?
    [/quote]

    If you start a new thread for this with some screenshots of exactly what you're looking for, I'll see what I can do. This sounds like it's more than doable. ;)
  9. Clara Listensprechen Member

    Member Since:
    Jul 14, 2011
    Tell you what--I posted the questions plus that sort of detail on the SMF forum HERE, which please see.
  10. Clara Listensprechen Member

    Member Since:
    Jul 14, 2011
    ...after you read that, then read this. The answer to my question there did solve the issue of the greeting as well as the date/time stamp. What remains at issue is the font of just the links, which I can alter as well on the css file BUT! when I change the font of those links, I change the font of ALL links, and that would make all but the header links unreadable. There's gotta be a way of making 'em different classes or something. I just don't know how to go about doing that.

    I see that the css I'm working on separates "normal links" from "links that open with a new window" as different classes, thus:

    Code:
    /* Normal, standard links. */
    a:link, a:visited
    {
    	color: #346;
    	text-decoration: none;
    }
    a:hover
    {
    	text-decoration: underline;
    	cursor: pointer;
    }
    
    /* Links that open in a new window. */
    a.new_win:link, a.new_win:visited
    {
    	color: #346;
    	text-decoration: none;
    }
    a.new_win:hover
    {
    	text-decoration: underline;
    }
    
    so maybe I'm looking at making a new class of a.headerlink or something? That means I'd have to specify those particular links as headerlinks somehow, unless they also appear elsewhere under some other display context. Yeah, I don't know how to proceed from here.

    The part of the index.template.php affected looks like this:

    Code:
    // If the user is logged in, display stuff like their name, new messages, etc.
    	if ($context['user']['is_logged'])
    	{
    		if (!empty($context['user']['avatar']))
    			echo '
    				<p class="avatar">', $context['user']['avatar']['image'], '</p>';
    		echo '
    				<ul class="reset">
    					<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
    					<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
    					<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';
    
    		// Is the forum in maintenance mode?
    		if ($context['in_maintenance'] && $context['user']['is_admin'])
    			echo '
    					<li class="notice">', $txt['maintain_mode_on'], '</li>';
    
    		// Are there any members waiting for approval?
    		if (!empty($context['unapproved_members']))
    			echo '
    					<li>', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=admin;area=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '</li>';
    
    		if (!empty($context['open_mod_reports']) && $context['show_open_reports'])
    			echo '
    					<li><a href="', $scripturl, '?action=moderate;area=reports">', sprintf($txt['mod_reports_waiting'], $context['open_mod_reports']), '</a></li>';
    
    		echo '
    					<li>', $context['current_time'], '</li>
    				</ul>';
    	}
    	// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
    	elseif (!empty($context['show_login_bar']))
    	{
    		echo '
    				<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
    				<form id="guest_form" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
    					<div class="info">', sprintf($txt['welcome_guest'], $txt['guest_title']), '</div>
    					<input type="text" name="user" size="10" class="input_text" />
    					<input type="password" name="passwrd" size="10" class="input_password" />
    					<select name="cookielength">
    						<option value="60">', $txt['one_hour'], '</option>
    						<option value="1440">', $txt['one_day'], '</option>
    						<option value="10080">', $txt['one_week'], '</option>
    						<option value="43200">', $txt['one_month'], '</option>
    						<option value="-1" selected="selected">', $txt['forever'], '</option>
    					</select>
    					<input type="submit" value="', $txt['login'], '" class="button_submit" /><br />
    					<div class="info">', $txt['quick_login_dec'], '</div>';
    
    		if (!empty($modSettings['enableOpenID']))
    			echo '
    					<br /><input type="text" name="openid_identifier" id="openid_url" size="25" class="input_text openid_login" />';
    
    		echo '
    					<input type="hidden" name="hash_passwrd" value="" />
    				</form>';
    	}
    
    	echo '
    			</div>
    			<div class="news normaltext">
    				<form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
    					<input type="text" name="search" value="" class="input_text" /> 
    					<input type="submit" name="submit" value="', $txt['search'], '" class="button_submit" />
    					<input type="hidden" name="advanced" value="0" />';
    
    	// Search within current topic?
    	if (!empty($context['current_topic']))
    		echo '
    					<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
    	// If we're on a certain board, limit it to this board ;).
    	elseif (!empty($context['current_board']))
    		echo '
    					<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
    
    	echo '</form>';
    
    	// Show a random news item? (or you could pick one from news_lines...)
    	if (!empty($settings['enable_news']))
    		echo '
    				<h2>', $txt['news'], ': </h2>
    				<p>', $context['random_news_line'], '</p>';
    
    	echo '
    			</div>
    		</div>
    		<br class="clear" />';
    
    	
    I included that much of it besides the unread link and the unreadreplies link because an Admin will see the rest of it unless as a Guest, and Guest is affected, too.
  11. The Craw Member

    Member Since:
    Oct 29, 2011
    Just add this code to your stylesheet, and it will turn the links in the header white.

    Code:
    #upper_section a
    {
    	color: #fff;
    }
  12. Clara Listensprechen Member

    Member Since:
    Jul 14, 2011
    That's the problem. It doesn't address the links in the header. Already did that and the links don't match the header text AND on a dark background they remain unreadable. I'm looking to address the links, not the header.
  13. The Craw Member

    Member Since:
    Oct 29, 2011
    Did you actually try the specific code I gave you? "#upper_section [size=12pt]a[/size]" only changes links.
  14. Clara Listensprechen Member

    Member Since:
    Jul 14, 2011
    Well, I thought I had, actually. And I actually got a white greeting, except for the links. I'll try again, maybe I got the wrong section.

    ==============================

    Confirmed, I altered wrong section. I added the code you offered and voila! Results! We can consider this solved, with many profuse thanks.

Share This Page