tag:blogger.com,1999:blog-10663684197367393602024-03-14T07:11:59.024-07:00Getting my thoughts straightAnonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.comBlogger61125tag:blogger.com,1999:blog-1066368419736739360.post-68113378035497068172013-09-20T09:37:00.003-07:002013-09-20T09:38:20.997-07:00College Fun - bootstrap framework basicsOkay guys so I'm at college now and busier than ever before. Currently I'm working on a plugin for an image theme for a few friends on WJ. I'm also learning to work with bootstrap as I'm getting a job developing for someone. I can't describe any details about the job and I won't be able to post any of my work but I will be able to post everything learned about bootstrap: <a href="http://getbootstrap.com/2.3.2/getting-started.html">http://getbootstrap.com/2.3.2/getting-started.html</a> And I'm not going to post anything about the plugin yet, but I will as soon as it's done. For now here's my notes/progress with the bootstrap framework:<br />
<ul>
<li>Bootstrap needs HTML5 as well as jQuery</li>
<li>Bootstrap sets a basic css template to work off of that controls the global display, typography and link styles. In specific it:</li>
<ul>
<li>Found in scaffolding.less:</li>
<ul>
<li>removes the body margin</li>
<li>makes the body bg color white</li>
<li>uses @baseFontFamily, @baseFontSize and @baseLineGeight attributes as our typographic base.</li>
<li>set link color with @linkColor and applies underline affect on hover</li>
</ul>
<li>Found in reset.less:</li>
<ul>
<li>built on normalize.css for bootstrap elements: <a href="http://getbootstrap.com/2.3.2/getting-started.html">http://getbootstrap.com/2.3.2/getting-started.html</a></li>
</ul>
</ul>
<li>without responsive css added, the bootstrap grid system uses a 12 col layout with a 940px wide container.</li>
<li>with responsive css, grid adapts to be 724px and 1170px depending on the viewing screen res.</li>
<ul>
<li>with this the columns become fluid and stack under each other</li>
</ul>
<li>Because there are 12 columns you need to make the spans add up to = 12. For example:</li>
</ul>
<code>
<div class="row"></code><br />
<code> <div class="span5">...</div></code><br />
<code> <div class="span5">...</div></code><br />
<code> <div calss="span2">...</div></code><br />
<code></div></code><br />
<ul>
<li>This creates a filled row. In the old bootstrap (2.x) you used to have to enter .row-fluid but in the new version of bootstrap you just use .row* and it's fluid automatically because there's no more "fixed grid".</li>
<li>You use .offset* for shifting columns.</li>
<li>For embedding two spans it would look like this:</li>
</ul>
<span style="font-family: monospace;"><div class="row"></span><br />
<span style="font-family: monospace;"> <div class="span10"></span><br />
<span style="font-family: monospace;"> <div class="row"></span><br />
<span style="font-family: monospace;"> <div class="span6">...</div></span><br />
<span style="font-family: monospace;"> <div class="span4">...</div></span><br />
<span style="font-family: monospace;"> </div></span><br />
<span style="font-family: monospace;"> </div></span><br />
<span style="font-family: monospace;"></div></span><br />
<br />
<ul>
<li>Use .container for different sections of the website.</li>
</ul>
<div>
Okay so this pretty much covers all the basics that I need to know about the bootstrap framework.</div>
Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-23839176370215860642013-08-17T13:20:00.001-07:002013-08-17T13:20:24.068-07:00Me again - custom image post type releaseSo I've successfully created the image variation custom post type which can be viewed live here: <a href="http://wpprojects.net63.net/?image_post=testing-the-image-post-type">http://wpprojects.net63.net/?image_post=testing-the-image-post-type</a><br />
<br />
The code for it can be seen here: <a href="https://gist.github.com/C-onnor/6258300">https://gist.github.com/C-onnor/6258300</a><br />
<br />
I like the way it came out. I'm sure I'll think of some new changes and other people will as well if they look through the code. Another thing of done today is messed with the content.php file and made it so only images will be displayed on the homepage and a no-image picture will be shown if there was no featured image set: <a href="http://pastebin.com/atzAXQZ5">http://pastebin.com/atzAXQZ5</a><br />
<br />
What's next? Idk, people keep promising me work and shit but so far no ones actually come through for me even when I'm doing everything for free. I'm gunna go back to making that b4b theme now and I'll save that for next post.Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-90008163850252439102013-08-07T21:17:00.000-07:002013-08-07T21:17:27.474-07:00Adding a custom meta box to a custom post type day 2Continuing off of yesterday, now that I have the CPT (custom post type) publishing problem solved I'm concentrating on the meta box again. I need to figure out a way to add inputs for inputting data. How? I'm not sure yet so I've decided to take a look at this plugin, <a href="http://wordpress.org/plugins/ml-slider/">http://wordpress.org/plugins/ml-slider/</a>, that uses something similar with the add slide button.<br />
<br />
I looked at the code from this for a couple of hours and got nowhere. So I foraged through a bunch of google search results and found code that does <b>exactly</b> what I wanted to do: <a href="https://gist.github.com/da1nonly/2057532">https://gist.github.com/da1nonly/2057532</a><br />
I mean it doesn't have the exact columns (inputs) I need but that's for me to change. First I need to understand the results and it's a bit late for that right now so I'm going to bed. Goodnight people.Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-11217465178596227602013-08-07T06:18:00.000-07:002013-08-07T06:18:59.799-07:00Adding a custom meta box to a custom post type day 1Building off of yesterday's progress (<a href="http://persteezy.blogspot.com/2013/08/custom-post-types-in-wordpress.html">http://persteezy.blogspot.com/2013/08/custom-post-types-in-wordpress.html</a>) there was an argument called <b>register_meta_box_cb</b> that was for a callback function that could be used to add a custom meta box using the add_meta_box func: <a href="http://codex.wordpress.org/Function_Reference/add_meta_box">http://codex.wordpress.org/Function_Reference/add_meta_box</a><br />
add_meta_box(id, title, callback, post type, context, priority, callback args);<br />
<br />
<ul>
<li><b>id</b> - ID of the meta box section</li>
<li><b>title</b> - visible title of the meta box</li>
<li><b>callback</b> - function for generating the meta box html and can only accept <b>two</b> args from the callback args parameter.</li>
<li><b>post type</b> - the post type you want the meta box in (Can I add this to the default post?)</li>
<li><b>context</b> - choose where you want the meta box (normal, advanced or side)</li>
<li><b>priority</b> - choose how important (placementwise) the meta box is</li>
<li><b>callback args</b> - arguments passed on to the callback func</li>
</ul>
<div>
So with just a few additions/mods to the code this is what it looks like now: <a href="http://pastebin.com/89rrkuww">http://pastebin.com/89rrkuww</a></div>
<div>
Which makes the image post type look like this:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji9-0FE7UDOpbFwf9bn-RlL_d0DetN-Ji8PHIyBNGIDxTPGwcYWNmgpYk0iUJqbY7j-_0_MNMGquSH7tovuHKggApdCRnSTeMtk_toH1GuICe0D1YqLyBJ2KrcUfA8sf-Iyrw7a1RBMgg/s1600/image+post+type.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji9-0FE7UDOpbFwf9bn-RlL_d0DetN-Ji8PHIyBNGIDxTPGwcYWNmgpYk0iUJqbY7j-_0_MNMGquSH7tovuHKggApdCRnSTeMtk_toH1GuICe0D1YqLyBJ2KrcUfA8sf-Iyrw7a1RBMgg/s400/image+post+type.png" width="400" /></a></div>
<div>
<br /></div>
<div>
Now reading through tutorials for creating inputs (<a href="http://wp.tutsplus.com/series/reusable-custom-meta-boxes/">http://wp.tutsplus.com/series/reusable-custom-meta-boxes/</a>) they seem to follow outdated techniques I saw when first trying to create my options panel. Skimming through other tutorials (that are a bit newer), I'm seeing the same thing. What gives? So the add_settings_section, add_settings_field and register_setting can't be used here? Well, I'm going to try using them anyways and I'll see how that works out for me (hopefully well).</div>
<div>
<br /></div>
<div>
After trying out the settings api they do in fact work but only with the save changes button which wouldn't work. I've also coded it the wrong way: <a href="http://pastebin.com/h0TZ1b3Z">http://pastebin.com/h0TZ1b3Z</a><br />
<br />
So starting over again I need to rethink how I'm going to code this. Before that comes though I've found that the post type isn't even working. I keep getting the error "You are not allowed to edit this post" so I went to stackexchange for help: <a href="http://wordpress.stackexchange.com/questions/109243/cant-publish-custom-post-type-you-are-not-allowed-to-edit-this-post/">http://wordpress.stackexchange.com/questions/109243/cant-publish-custom-post-type-you-are-not-allowed-to-edit-this-post/</a><br />
And with the community's help I found a fix but I'm unsure why it's working.<br />
<br />
I meant to post this last night but forgot so I'm posting it today lol</div>
Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-41110469501531662012013-08-05T22:09:00.000-07:002013-08-05T22:09:21.697-07:00Custom post types in wordpressToday I've upgraded majority of my localhost wp blogs to wp 3.6: <a href="http://codex.wordpress.org/Version_3.6#Scripts.2C_External_Libraries">http://codex.wordpress.org/Version_3.6#Scripts.2C_External_Libraries</a><br />
I've also been given a new task from someone on skype. The task is to create a custom post type that works as the default post type but also has a custom meta box (named image) with input fields for color, size, download link. This is a simple sketch as to what I want it to look like this:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWNf0lDtgcCO93QKI8pgyObQgDwu5qtB1zOx1nMP3r7oN0fG9DbcqbtSpFqjyH9ZFt53OdRBfAAbXwRB0W0jYUCO9sZv2f2EnzmWomDnkD1K8uWAL6GL8BZqqMKGLoh78WJDAD4QskIGw/s1600/variation+box+design.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="267" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWNf0lDtgcCO93QKI8pgyObQgDwu5qtB1zOx1nMP3r7oN0fG9DbcqbtSpFqjyH9ZFt53OdRBfAAbXwRB0W0jYUCO9sZv2f2EnzmWomDnkD1K8uWAL6GL8BZqqMKGLoh78WJDAD4QskIGw/s400/variation+box+design.png" width="400" /></a></div>
Okay so I've messed with custom post types before but I forget how to get started with them and can't find a post on here about it so I'm just gunna take some notes on this: <a href="http://codex.wordpress.org/Post_Types">http://codex.wordpress.org/Post_Types</a><br />
<br />
First off, custom post types get registered using the register_post_type func: <a href="http://codex.wordpress.org/Function_Reference/register_post_type">http://codex.wordpress.org/Function_Reference/register_post_type</a><br />
register_post_type(Name, Args);<br />
<br />
This function must be hooked before the admin_menu and after_setup_theme hooks. It's recommended that the init hook is used. At the end of today using what I've read so far this is the code I've made for the custom post type: <a href="http://pastebin.com/nxvqPFu5">http://pastebin.com/nxvqPFu5</a><br />
<br />
Now that I've learned to add the custom post type I can focus on adding a custom meta box tomorrow.Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-21758023768391542912013-08-03T23:41:00.000-07:002013-08-03T23:41:32.574-07:00Cool guy has chill dayNot much went on today. I talked to a few people on WJ. I know I said I stopped with forums but I feel I need to go back to build up a portfolio. So while talking to people an idea popped into my head where I create a group of people looking to do free conversion services in order to buildup their portfolio. I've created a thread to recruit people here: <a href="http://www.wjunction.com/92-development-area/177734-looking-build-your-portfolio.html">http://www.wjunction.com/92-development-area/177734-looking-build-your-portfolio.html</a><br />
Unfortunately there have been no takers to the idea which could be foreshadowing the future.<br />
<br />
Anyways while waiting for people to PM me I saw this thread in the dev section: <a href="http://www.wjunction.com/92-development-area/177510-why-php-domdocument-getelementsbytagname-not-finding-all-elements.html#post1868952">http://www.wjunction.com/92-development-area/177510-why-php-domdocument-getelementsbytagname-not-finding-all-elements.html#post1868952</a><br />
I could not solve his problem but in attempting to do so I learned a couple new things. The first thing I learned was that since majority of web pages don't have properly formatted html PHP DOM will throw an amazing amount of annoying error messages that look like this:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjTjyNEWOQzkkS5rQUb2-oOi_vED8C-46kNnfM79rLn_u_-Agxb1Q3lMdo-PyzD709u4v0G-jCcOfgr7FVPp3QTnBXoo1kc3Lx3gsSDLA5zC145JTtQ2H6wFcec5JDD4EUyI9UailrWXY/s1600/annoying+php+dom.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="207" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjTjyNEWOQzkkS5rQUb2-oOi_vED8C-46kNnfM79rLn_u_-Agxb1Q3lMdo-PyzD709u4v0G-jCcOfgr7FVPp3QTnBXoo1kc3Lx3gsSDLA5zC145JTtQ2H6wFcec5JDD4EUyI9UailrWXY/s400/annoying+php+dom.png" width="400" /></a></div>
To avoid this I followed one of the answers to this post: <a href="http://stackoverflow.com/questions/7082401/avoid-domdocument-xml-warnings-in-php">http://stackoverflow.com/questions/7082401/avoid-domdocument-xml-warnings-in-php</a><br />
<br />
Anyways there's 13 links on the page that Filenuke (the user on wj seeking help) is trying to scrape. His code scraped 8 links and my code scraped 9 links (not much better). Here's my end result: <a href="http://pastebin.com/QEje2be0">http://pastebin.com/QEje2be0</a><br />
<br />
Other than this, nothing else happened today. Maybe I'll shift back into the crypter or wordpress tomorrow. Pce!Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-3588062501842690252013-08-03T09:07:00.001-07:002013-08-03T09:07:46.644-07:00Back from a malware attack!Well recently I was the victim of a Java Drive-by (JDB). I don't think the malware came from opening anything related to the crypter. Anyways thanks to Paradoxum's help on HF the malware is gone and my system is much more secure than before. To see everything that happened, check this thread: <a href="http://hackforums.net/showthread.php?tid=3661673">http://hackforums.net/showthread.php?tid=3661673</a><br />
<br />
Now that this is over I'm back to posting normally again.Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-25052715474906276272013-07-30T23:44:00.000-07:002013-07-30T23:44:25.393-07:00Switchin it up - Learning how a crypter worksToday I switched things up and decided to see how a vb.net crypter works. I searched through HF for a simple crypter source and found just what I needed: <a href="http://www.hackforums.net/showthread.php?tid=3556669&highlight=Castle+Crypter+V0.1+Source">http://www.hackforums.net/showthread.php?tid=3556669&highlight=Castle+Crypter+V0.1+Source</a><br />
<br />
I've begun the process of going through literally every single line of code to fully understand everything. This is what the solution explorer looks like for the crypter:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigF5pJdeUyOvjgGytVLgv1O1skOO6ybfHIkFKJejJ8LmEfPyE1j3YOaUyydofglJ_cg-LcGL8Jp7d7hQHguQkaQnb49n386eb9YNDJBX_P7qX-DXmcTYSwhm9XSA41L2RlV_3FClsY8Qs/s1600/solution.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigF5pJdeUyOvjgGytVLgv1O1skOO6ybfHIkFKJejJ8LmEfPyE1j3YOaUyydofglJ_cg-LcGL8Jp7d7hQHguQkaQnb49n386eb9YNDJBX_P7qX-DXmcTYSwhm9XSA41L2RlV_3FClsY8Qs/s1600/solution.png" /></a></div>
So far I've only fully summarized the Form1.vb: <a href="http://pastebin.com/xSTSmt1V">http://pastebin.com/xSTSmt1V</a><br />
In doing so I've gotten a pretty good idea of what each file is good for:<br />
<br />
<ul>
<li>Form1.vb - holds the encrypt and random string functions, filepaths, encryption keys, replacements that are made to the stub code and compilation of the crypted file as well as the addition of a resource that holds the encrypted code.</li>
<li>Stub.txt - holds the stub source for a runPE type crypt.</li>
<li>Stub 2.txt - holds the stub source for a drop type crypt.</li>
<li>clsCodeDom.vb - holds the Compile function where the codedom import is used. I think this is done to avoid detections but I'm not sure.</li>
<li>IconChanger.vb - holds the InjectIcon function where the selected icon (if there is one) is implemented to the crypted file.</li>
<li>Controls folder - contains .vb files used for creating custom controls (not important).</li>
<li>Stub 1 & 2 Edit.vb - same as Stub.txt and Stub 2.txt juts in .vb files so you can see and edit things a little bit easier.</li>
</ul>
<div>
In the end, I hope to comment out the stub files and codedom and iconchanger classes as well. This topic interests me quite a bit and it feel nice to take a break from wordpress and web development.</div>
Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-70572330876367526102013-07-29T21:20:00.000-07:002013-07-29T21:20:03.640-07:00Continuing yesterdays efforts - day 11Continuing off of yesterday I figured out how to get the twitter dialog working correctly thanks to this dude: <a href="http://gpiot.com/elegant-twitter-share-button-and-dialog-with-jquery/">http://gpiot.com/elegant-twitter-share-button-and-dialog-with-jquery/</a><br />
<div>
Here's the working code:</div>
<div>
<code>$content .= '<li><a href="#" onclick="window.open(\'https://twitter.com/share?url=' . esc_url('http:\\' . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]) . '&text=Check this out!: ' . esc_url($_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]) . '&\', \'facebook-share-dialog\', \'width=626,height=436\'); return false;">tw</a></li>';</code></div>
<div>
To get it to work I just had to had the &text attribute.</div>
<div>
<br /></div>
<div>
Now for the google plus button. I ran into the same issue as the twitter button leaving me to believe that I need to find out why I can't use $_SERVER commands or get_permalink for the url. I revised the entire function so it looks like this now:</div>
<div>
<div>
<code>function b4b_sharing_enabled($content){</code></div>
<code>
</code>
<br />
<div>
<code><span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_options = get_option('b4b_theme_display_options');</code></div>
<code>
</code>
<br />
<div>
<code><span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_share_post_enable = $b4b_options['share_post_enable'];</code></div>
<code>
</code>
<br />
<div>
<code><span class="Apple-tab-span" style="white-space: pre;"> </span></code></div>
<code>
</code>
<br />
<div>
<code><span class="Apple-tab-span" style="white-space: pre;"> </span>if ($b4b_share_post_enable && is_single() || is_page()){</code></div>
<code>
</code>
<div>
<code><span class="Apple-tab-span" style="white-space: pre;"> </span>$url = get_permalink();</code></div>
<code>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>$content .= '<nav class="sharethis"><ul>';</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>$content .= '<li><a href="https://www.facebook.com/sharer/sharer.php?u=' . esc_url($url) . '" onclick="window.open(this.href, \'facebook-share-dialog\', \'resizable=yes,width=626,height=436\'); return false;">facebook</a></li>';</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>$content .= '<li><a href="https://twitter.com/share?url=' . esc_url($url) . '" onclick="window.open(this.href, \'twitter-share-dialog\', \'resizable=yes,width=626,height=436\'); return false;">twitter</a></li>';</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>$content .= '<li><a href="https://plus.google.com/share?url=' . esc_url($url) . '" onclick="window.open(this.href, \'googleplus-share-dialog\', \'resizable=yes,width=626,height=436\'); return false;">googleplus</a></li>';</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>$content .= '</ul></nav>';</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>return $content;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>} else {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>return $content;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
}</div>
<div>
add_filter('the_content', 'b4b_sharing_enabled');</div>
</code>
</div>
I couldn't figure this out on my own so I've asked a question on it here: <a href="http://wordpress.stackexchange.com/questions/108241/sharing-buttons-url-doesnt-show-up-in-dialog-box">http://wordpress.stackexchange.com/questions/108241/sharing-buttons-url-doesnt-show-up-in-dialog-box</a><br />
While waiting for people to answer I'm going to work on the footer settings because I'm going to include the implication of the author bio in the same b4b_sharing_enabled function (except I'll rename it).<br />
<br />
This is what I wrote for applying all of the footer options:<br />
<code>function b4b_footer_options(){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_options = get_option('b4b_theme_display_options');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_social_icons_enable = $b4b_options['social_icons_enable'];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_facebook_url = $b4b_options['facebook_url'];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_twitter_url = $b4b_options['twitter_url'];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_footer_text = $b4b_options['footer_text'];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if($b4b_social_icons_enable){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>?><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><nav class="socialicons"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><ul><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><?php<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if($b4b_facebook_url != ''){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo '<li><a href="' . $b4b_facebook_url . '">facebook</a></li>';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if($b4b_twitter_url != ''){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo '<li><a href="' . $b4b_twitter_url . '">twitter</a></li>';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>?><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></ul><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></nav><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><?php<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if($b4b_footer_text != ''){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo '<p>' . $b4b_footer_text . '</p>';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
}<br />
add_action('wp_footer', 'b4b_footer_options');</code><br />
This is what the footer.php looks like now after a few modifications to it: <a href="http://pastebin.com/Vb7sFU9f">http://pastebin.com/Vb7sFU9f</a><br />
One issue I've noticed though is that you can enter in non-urls into the facebook and twitter url inputs and the text in footer input is too small. This means I need to make some adjustments to the validation function and input callback.<br />
I've split up the textarea callback into an input and textarea callback. Here's what I'm left with after making these changes:<br />
<code>function b4b_input_callback($args){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$options = get_option('b4b_theme_display_options');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if($args[0]=="number_of_posts"){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html = '<input type="number"';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html .= ' pattern="\d*"';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>} elseif ($args[0]=="facebook_url" || $args[0]=="twitter_url"){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html = '<input type="url"';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>} else {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html = '<input type="text"';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html .= ' id="' . $args[0] . '" name="b4b_theme_display_options[' . $args[0] . ']" value="' . $options[$args[0]] . '" />';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo $html;<br />
}<br />
<br />
function b4b_textarea_callback($args){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$options = get_option('b4b_theme_display_options');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html = '<textarea id="' . $args[0] . '" name="b4b_theme_display_options[' . $args[0] . ']" rows="' . $args[1] . '" cols="' . $args[2] . '">' . $options[$args[0]] . '</textarea>';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo $html;<br />
}</code><br />
The footer_text field is the only option utilizing the textarea callback. Upon completing this I've also come to realize that I left all the applied options in the header.php and never took them out to put in the theme-options.php; so I'll make these changes now. First I changed the header to this:<br />
Then I added the following hook function: <a href="http://pastebin.com/cqsmRnrT">http://pastebin.com/cqsmRnrT</a><br />
<code>function b4b_header_options(){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_options = get_option('b4b_theme_display_options');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_header_type = $b4b_options['header_type'];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_header_image = $b4b_options['header_image'];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_header_title = $b4b_options['header_title'];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_header_slogan = $b4b_options['header_slogan'];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if ($b4b_header_type == 'image'){ ?><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><img src="<?php echo $b4b_header_image; ?>" alt="logo" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></a><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><?php } elseif($b4b_header_type && $b4b_header_title == '' && $b4b_header_slogan == '') { ?><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><h2 class="site-description"><?php bloginfo( 'description' ); ?></h2><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><?php } elseif($b4b_header_type && $b4b_header_title != '' && $b4b_header_slogan != '') { ?><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( $b4b_header_title ); ?>" rel="home"><?php echo esc_attr( $b4b_header_title ); ?></a></h1><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><h2 class="site-description"><?php echo $b4b_header_slogan ?></h2><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><?php }<br />
}<br />
add_action('site-branding', 'b4b_header_options');</code><br />
<b>Please note: </b>The site-branding hook is the custom hook that I added into the header.php.<br />
<br />
After all the changes I've wrote about so far this is what the theme-options.php currently looks like: <a href="http://pastebin.com/LvXcsGPr">http://pastebin.com/LvXcsGPr</a><br />
<br />
I still haven't received any help on the sharing buttons problem so I have the rare opportunity to work on something different. I'm going to browse through the tutorials on wp.tutsplus.com cause I can always find something new on there. This tutorial series about coding standards seems useful and interesting so I'm going to summarize whatever I get through: <a href="http://wp.tutsplus.com/series/the-wordpress-coding-standards/">http://wp.tutsplus.com/series/the-wordpress-coding-standards/</a><br />
<br />
Well, I got distracted and went out instead. I'm going to sleep now, so if there isn't any type of assistance tomorrow I'll come back to it.Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-82019617684578473612013-07-28T22:09:00.000-07:002013-07-28T22:09:57.656-07:00New plans for coding the options panel - day 10I've decided that it would be a could idea to keep all (or as much as possible) of the settings usage in the theme-options.php. Why? I just like the idea of making it a lot more portable so I can bring it to other themes I work on. This being said, with the help of the query_posts wp documentation I removed the usage of query_posts from the index.php and used the pre_get_posts hook in the theme-options.php instead:<br />
<code>function b4b_number_of_posts($query){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_options = get_option('b4b_theme_display_options');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_number_of_posts = $b4b_options['number_of_posts'];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if($b4b_number_of_posts != '' && $query->is_home() && $query->is_main_query()){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$query->set('posts_per_page', $b4b_number_of_posts);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
}<br />
add_action('pre_get_posts', 'b4b_number_of_posts');</code><br />
<br />
Now I can go back to the share this buttons. First I need to find the hook that I can use for the usage function which I'm looking for in here: <a href="http://codex.wordpress.org/Plugin_API/Action_Reference">http://codex.wordpress.org/Plugin_API/Action_Reference</a><br />
I thought pre_get_commments would be what I was looking for but upon running the following code it only puts "TESTING" before the recent comments widget:<br />
<code>function b4b_sharing_enabled(){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo '<h1><b>TESTING</b></h1';<br />
}<br />
add_action('pre_get_comments', 'b4b_sharing_enabled');</code><br />
<br />
After reading through this article, <a href="http://wp.tutsplus.com/tutorials/the-beginners-guide-to-wordpress-actions-and-filters/">http://wp.tutsplus.com/tutorials/the-beginners-guide-to-wordpress-actions-and-filters/</a>, I've realized I need to look for a filter instead in here: <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference">http://codex.wordpress.org/Plugin_API/Filter_Reference</a><br />
<br />
So to add something to the end of your content I've found you only have to do this:<br />
<code>function b4b_sharing_enabled($content){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$content .= '<h1><b>TESTING</b></h1>';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return $content;<br />
}<br />
add_filter('the_content', 'b4b_sharing_enabled');</code><br />
<br />
Leaving you with:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbGMaoMeeJ_fvwJvM0hQ7ls6F1s19TXRfsthdBR1OV9YgIRygBw8ubuqWfpu6f-ZPkBLruK7_huC8n3aaLfq-_qMiPxCEWUIXLyJ3lOdxkXnbcpkLnjT-FjQ1VPAPsLdQ5v5MdTuvOVQ/s1600/filter+works.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="146" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbGMaoMeeJ_fvwJvM0hQ7ls6F1s19TXRfsthdBR1OV9YgIRygBw8ubuqWfpu6f-ZPkBLruK7_huC8n3aaLfq-_qMiPxCEWUIXLyJ3lOdxkXnbcpkLnjT-FjQ1VPAPsLdQ5v5MdTuvOVQ/s320/filter+works.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
I've been working on the social buttons for a couple hours now only to get stuck on the damn twitter button. Here's the current code:<br />
<code>function b4b_sharing_enabled($content){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$content .= '<nav class="sharethis"><ul>';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$content .= '<li><a href="#" onclick="window.open(\'https://www.facebook.com/sharer/sharer.php?u=' . esc_url('http:\/\/'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]) . '\', \'facebook-share-dialog\', \'width=626,height=436\'); return false;">fb</a></li>';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$content .= '<li><a href="#" onclick="window.open(\'https://twitter.com/share?url=' . esc_url('http:\\' . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]) . '\', \'facebook-share-dialog\', \'width=626,height=436\'); return false;">tw</a></li>';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$content .= '</ul></nav>';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return $content;<br />
}<br />
add_filter('the_content', 'b4b_sharing_enabled');</code><br />
<br />
The popup for the twitter button works but the problem is the url doesn't show up in the tweet like it should. If I replace <b>$_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]</b> with a simple url like google.com it works. Why is this the issue? I guess I'll just have to take a look at it tomorrow. I'm done today.Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-77086016053746433712013-07-27T21:14:00.001-07:002013-07-27T21:14:05.016-07:00Options Panel - day 9So continuing from yesterday I'm working on the number of posts per page option. The first thing I was working on was choosing whether to remove numbers using jquery on keyup or using php and just changing the input type. The jQuery version looks like this:<br />
<code>//only allow numbers to be entered<br />
$('#number_of_posts').keyup(function(e){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(/\D/g.test(this.value)){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>this.value = this.value.replace(/\D/g, '');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
});</code><br />
I got this solution from here: <a href="http://stackoverflow.com/questions/995183/how-to-allow-only-numeric-0-9-in-html-inputbox-using-jquery">http://stackoverflow.com/questions/995183/how-to-allow-only-numeric-0-9-in-html-inputbox-using-jquery</a><br />
<br />
This is the php function which involved me changing the textarea callback:<br />
<code>function b4b_textarea_callback($args){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$options = get_option('b4b_theme_display_options');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if($args[0]=="number_of_posts"){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html = '<input type="number"';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html .= ' pattern="\d*"';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>} else {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html = '<input type="text"';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html .= ' id="' . $args[0] . '" name="b4b_theme_display_options[' . $args[0] . ']" value="' . $options[$args[0]] . '" />';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo $html;<br />
}</code><br />
I got help to find this solution from here: <a href="http://stackoverflow.com/questions/8808590/html5-number-input-type-that-takes-only-integers">http://stackoverflow.com/questions/8808590/html5-number-input-type-that-takes-only-integers</a><br />
Rather than replacing anything besides numbers with letters right away this allows for the letters to be entered and doesn't allow them to be saved. I've decided to use the php solution instead of the jQuery one because letters can still be saved if the user clicks the save button right away.<br />
<br />
Lastly this is the php code I made for querying the amount of posts:<br />
<code><?php<br />
$options = get_option( 'b4b_theme_display_options' );<br />
$number_of_posts = $options['number_of_posts'];<br />
<br />
if($number_of_posts != ''){<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$args = 'posts_per_page=' . $number_of_posts;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>query_posts($args);<br />
}<br />
?></code><br />
<br />
Next is the enabling sharing in posts option. Planning this more in detail, this option will have a sharing button for Facebook, Twitter, Email and Google Plus. These developer pages will help me create the code I need for the share buttons:<br />
<br />
<ul>
<li><a href="https://developers.facebook.com/docs/reference/plugins/share-links/">https://developers.facebook.com/docs/reference/plugins/share-links/</a></li>
<li><a href="https://dev.twitter.com/docs/tweet-button">https://dev.twitter.com/docs/tweet-button</a></li>
<li><a href="https://developers.google.com/+/web/share/">https://developers.google.com/+/web/share/</a></li>
</ul>
<div>
As for the email share button, that's something I want to try writing from scratch as a learning experience. As of now I have a headache so I'm leaving this option for tomorrow.</div>
Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-2228396614090741612013-07-26T21:13:00.002-07:002013-07-26T21:13:38.484-07:00Yet another day on the options panel - day 8I'm jumping right into the last tutorial today: <a href="http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-8-validation-sanitisation-and-input-ii/">http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-8-validation-sanitisation-and-input-ii/</a><br />
<br />
First, the author goes to add a checkbox field into the example section he created yesterday. I've already created my own checkbox callback but the author goes more into detail explaining it. Here is my code:<br />
<code>function b4b_checkbox_callback($args){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$options = get_option('b4b_theme_display_options');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html = '<input type="checkbox" id="' . $args[0] . '" name="b4b_theme_display_options[' . $args[0] . ']" value="1" ' . checked(1, $options[$args[0]], false) . '/>';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html .= '<label for="' . $args[0] . '"> ' . $args[1] . '</label>';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo $html;<br />
}</code><br />
This makes use of the checked func: <a href="http://codex.wordpress.org/Function_Reference/checked">http://codex.wordpress.org/Function_Reference/checked</a><br />
To use this I would simply use an if loop to check if the saved options value is 1 or not.<br />
<br />
Then the author goes through the callback for a radio button. It's pretty much the same as a checkbox as it uses the checked function but the $checked parameter increments for each radio button in the set. Again, to use the label to check the radio button just set the label's "for" attribute equal to the radio button's ID.<br />
<br />
Lastly the author shows how to make the callback for the select control, which I've already done again. Here's the code I've used for it:<br />
<code>function b4b_select_callback($args){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$options = get_option('b4b_theme_display_options');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html = '<select id="' . $args[Count($args)-2] . '" name="b4b_theme_display_options[' . $args[Count($args)-2] . ']">';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>foreach($args as $arg){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if ($args[Count($args)-1] != $arg && $args[Count($args)-2] != $arg){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html .= '<option value="' . $arg . '"' . selected($options[$args[Count($args)-2]], $arg, false) . '>' . $arg . '</option>';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html .= '</select>';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$html .= '<label for="' . $args[Count($args)-2] . '">' . $args[Count($args)-1] . '</label>';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo $html;<br />
}</code><br />
This makes use of the selected func: <a href="http://codex.wordpress.org/Function_Reference/selected">http://codex.wordpress.org/Function_Reference/selected</a><br />
<br />
After reading skimming through some of the tutorials again and browsing through the codex this is what my final header looks like: <a href="http://pastebin.com/SRdwSmhe">http://pastebin.com/SRdwSmhe</a><br />
<br />
Now that the header is done I'm going to put a bit of planning for the other options down:<br />
<ul>
<li>To display the favicon I'm just going to implement (to <u>theme-options.php</u>) the display favicon code from this author's tutorial: <a href="http://wp.tutsplus.com/tutorials/creative-coding/integrating-the-wp-media-uploader-into-your-theme-with-jquery/?search_index=2">http://wp.tutsplus.com/tutorials/creative-coding/integrating-the-wp-media-uploader-into-your-theme-with-jquery/?search_index=2</a></li>
<li>To control the number of posts on the home page I first need to edit the validation callback so it will only accept numbers. Then before the loop (in <u>index.php</u>) I'd want to use query_posts(<a href="http://codex.wordpress.org/Function_Reference/query_posts">http://codex.wordpress.org/Function_Reference/query_posts</a>) in combination with retrieving the option (sanitized). <b>It's important to keep in mind that this option is useless since there are already options for this in Settings->Reading.</b></li>
<li>Code for the enable sharing posts and author bio options will go in the <u>page.php</u> between the get_template_part func and code for the comment loop.</li>
<li>The enable social icons (in the footer) option will go in the <u>footer.php</u> and be an if loop to decide whether it will display or not.</li>
<li>Text in footer controls the text in the footer that is shown at the very bottom and centered in a very light blue.</li>
<li>Facebook & Twitter url inputs first need to be changed so only a valid url can be saved. Then it will be made (in <u>footer.php</u>) so that if they are blank their button won't appear. </li>
</ul>
<div>
Okay so here's the favicon options code:</div>
<div>
<div>
<code>function b4b_add_favicon(){</code></div>
<code>
</code>
<div>
<code><span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_options = get_option('b4b_theme_display_options');</code></div>
<code>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>$b4b_favicon = $b4b_options['favicon_image'];</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>?></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span><link rel="icon" type="image/png" href="<?php echo esc_url($b4b_favicon); ?>"></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span><?php</div>
<div>
}</div>
<div>
add_action('wp_head', 'b4b_add_favicon');</div>
</code>
</div>
<br />
That's it for today. More will come tomorrow.<br />
<br />Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-67012039486480858972013-07-25T22:11:00.000-07:002013-07-25T22:11:08.414-07:00Today's wp work - day 7Before I implement any more options in the theme I'm going back to the settings api tutorials and finishing summarizing them.<br />
<br />
In the sixth tutorial, <a href="http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-6-menu-pages/">http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-6-menu-pages/</a>, the author is teaching how to introduce a top-level menu, add two submenus that will link to different tabs. This will be making use of the add_menu_page and add_submenu_page functions I explained in better detail here: <a href="http://persteezy.blogspot.com/2013/07/options-panel-day-5-wordpress-menu-types.html">http://persteezy.blogspot.com/2013/07/options-panel-day-5-wordpress-menu-types.html</a><br />
<br />
Now this goal is all fine and dandy but I couldn't get the tabs from the 5th tutorial (<a href="http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-5-tabbed-navigation-for-your-settings-page/">http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-5-tabbed-navigation-for-your-settings-page/</a>) to work and since this tutorial builds upon that working I can only summarize what he's saying now. The 5th tutorial not only didn't work for me but it didn't work for another person as well.<br />
<br />
Simply reading through the tut now, the author used add_theme_page and add_menu_page in a function that's hooked to the admin_menu hook. Then a submenu (goes under top-level) item for one of the tabs is added using the add_submenu_page leaving you with <b>two</b> submenu items. Two? Yes, that's because the add_menu_page also leaves the user with a submenu page with the same name and callback function. After this, a third submenu page is added for the second option.<br />
<br />
Author then adds a tab parameter (default value of null) to the *_theme_display func grabs the value of tab and assigns it to a var, creates an if loop that checks what the var equals and reassigns the var depending on what it equals. Then to utilize this change the author changes the callback of the submenu to something like this:<br />
<code><span style="font-family: Consolas, Courier New, Courier, mono;"><span style="font-size: 12.222222328186035px; line-height: 13.993056297302246px;">create_function( null, 'sandbox_theme_display( "social_options" );' ) </span></span></code><br />
create_function explained: <a href="http://php.net/manual/en/function.create-function.php">http://php.net/manual/en/function.create-function.php</a><br />
<br />
Now this would be great to implement if the tabs worked but they don't and I don't plan on looking for a solution until another time. Honestly I think jQuery is probably the better solution here because (A) I'm not very good with ajax and (B) it cuts back on load time majorly. Now I'm onto tut #7: <a href="http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-7-validation-sanitisation-and-input-i/">http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-7-validation-sanitisation-and-input-i/</a><br />
<br />
<b>Validation</b> - the process by which data entered into the options page by the user is examined and it is determined whether it's acceptable to save.<br />
<br />
<b>Sanitization</b> - the process by which data coming out of the database is assured to be clean and properly formatted for rendering.<br />
<br />
So validation should be done before data gets written to the db and sanitization should be done between loading the data from the db and displaying it in the browser. The author then goes to add a new input_examples function, create a submenu for it, and add it to the tabs like the other functions. He then adds an input field to the tab that will be used to test validation.<br />
<br />
The third parameter for the register_setting function is what gets used for the validation function callback. The function should accept the $input parameter which will obviously hold the data to be validated. This function will normally follow these three steps:<br />
<ul>
<li>Create an array for storing validated options</li>
<li>Validate the options</li>
<li>Return the created array</li>
</ul>
<div>
In the author's validation function he does this then uses a foreach to loop through the inputs. If the loop is not null (isset: <a href="http://php.net/manual/en/function.isset.php">http://php.net/manual/en/function.isset.php</a>) then the author makes use of two php functions to validate the input and add it too $ouput at the same time:</div>
<div>
<ul>
<li>strip_tags (strip html tags): <a href="http://php.net/manual/en/function.strip-tags.php">http://php.net/manual/en/function.strip-tags.php</a></li>
<li>stripslashes (takes of backslashes): <a href="http://php.net/manual/en/function.stripslashes.php">http://php.net/manual/en/function.stripslashes.php</a></li>
</ul>
<div>
Not sure why the user doesn't try making use of the esc_html and esc_url wp functions but I guess I'll just have to continue reading and find out. Here's the validation function in my code:</div>
</div>
<div>
<div>
<code>function b4b_theme_display_options_validation($input){</code></div>
<code>
</code>
<div>
<code><span class="Apple-tab-span" style="white-space: pre;"> </span>$output = array();</code></div>
<code>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>foreach($input as $key => $value){</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(isset($input[$key])){</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>$output[$key] = strip_tags(stripslashes($input[$key]));</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>return apply_filters('b4b_theme_display_options_validation', $output, $input);</div>
<div>
}</div>
</code></div>
apply_filters(<a href="http://codex.wordpress.org/Function_Reference/apply_filters">http://codex.wordpress.org/Function_Reference/apply_filters</a>) is used because it is just known as a best practice (idk).<br />
<br />
The author then uses sanitize_text_field(<a href="http://codex.wordpress.org/Function_Reference/sanitize_text_field">http://codex.wordpress.org/Function_Reference/sanitize_text_field</a>) for echoing the options.<br />
<br />
This concludes the tutorial and my wp work for today. The author included me with one link that I'm now using as a reference: <a href="http://codex.wordpress.org/Data_Validation">http://codex.wordpress.org/Data_Validation</a><br />
One more tut in the series to go and I plan on finishing it tomorrow.Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-15487258050115933912013-07-24T22:38:00.001-07:002013-07-24T22:38:12.236-07:00Unfocused.Honestly these I've been having a very bad motivational issue with doing anything computer programming related and it's starting to piss me off. I once used to love programming for the fun of it and now I'm only worried about one thing and that's money. I've applied to countless jobs (near and far) but absolutely no one wanted to hire me because I have absolutely no work experience in retail or computer hardware, I'd only be working for a short amount of time (because I'm off to college soon), and there's no open web developer positions that will hire someone with just a high school education and not even a portfolio website.<br />
<br />
I find myself constantly looking (and wasting my time) to make "easy money" online rather than to focus on improving my programming skill and building a much stronger portfolio. For example, just the other day I bought a shit ebook on HF that's supposed to teach me how to get free one month xbox live codes and spent hours trying to make it work and plotting ways I can change the method to make it work. The method will never work and was just a waste of a $25 Amazon GC.<br />
<br />
From this point on (like with MapleStory), I've decided that I'm done with forums. Yes, that means I'm officially off WJ, HF, TBN, & HC until I improve my skill to the point where I can create amazing things and make money doing something I love. I've been told this before by my lawyer and he said:<br />
<blockquote class="tr_bq">
Don't focus on making money at such a young age (I was 17 at the time). Just focus on improving and getting better at your talent and the money will come.</blockquote>
When I first heard this it went in one ear and out the other because I was so convinced that making money at that age was the most important thing I could possibly too because I wanted to be able to get whatever I wanted without struggle. Now, I'm realizing how true this statement is. If I continue trying to make money in semi-illegitimate ways and not utilizing my talent I won't turn into anything but a fraudster and a criminal. I need to focus on building my skills and create my own path to the riches in a completely legal way.<br />
<br />
That's all I have for today. Sorry for posting all this bullshit and none of the usual coding stuff but this was just another thought I needed to get straight. However I did implement the header options into the b4b theme through the header.php file by inserting the following:<br />
<a href="http://www.blogger.com/blogger.g?blogID=1066368419736739360" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><code><?php $display_options = get_option( 'b4b_theme_display_options' ); ?><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><div class="site-branding"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><?php if ($display_options['header_type'] == 'image'){ ?><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><img src="<?php echo $display_options['header_image']; ?>" alt="logo" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><?php } elseif($display_options['header_type'] == 'text' && $display_options['header_title'] == '' && $display_options['header_slogan'] == '') { ?><br />
<a href="http://www.blogger.com/blogger.g?blogID=1066368419736739360" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><span class="Apple-tab-span" style="white-space: pre;"> </span><h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><h2 class="site-description"><?php bloginfo( 'description' ); ?></h2><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><?php } elseif($display_options['header_type'] == 'text' && $display_options['header_title'] != '' && $display_options['header_slogan'] != '') { ?><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( $display_options['header_title'] ); ?>" rel="home"><?php echo esc_attr( $display_options['header_title'] ); ?></a></h1><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><h2 class="site-description"><?php echo esc_attr( $display_options['header_slogan'] ); ?></h2><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><?php } ?><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></div></code><br />
Going to bed now. There'll probably be more activity on here from now on.Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-35390283485211027932013-07-22T21:53:00.002-07:002013-07-22T21:53:47.660-07:00Back from vacation! - my options panelSorry I forgot to tell you guys that I was going on vacation for a bit. I didn't have a reliable internet connection where I was so I couldn't make any posts. Anyways I pretty much finished the basic aesthetics and options for the options panel in the new theme I'm making.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzAK-l6asnGzOrLOwfyAlkyrxPwwJIzr1tDviiddyLtz1BgUkIoGq5bdfQvrY2Mpzpl05RcqMT-aSvrt_rlSdTc0jnif0gHtgqO6HHbBCsIrYc5YRLACVKu4hPj0QoAQTrBW62yEsqPS8/s1600/general+settings.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="114" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzAK-l6asnGzOrLOwfyAlkyrxPwwJIzr1tDviiddyLtz1BgUkIoGq5bdfQvrY2Mpzpl05RcqMT-aSvrt_rlSdTc0jnif0gHtgqO6HHbBCsIrYc5YRLACVKu4hPj0QoAQTrBW62yEsqPS8/s320/general+settings.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZIrIyWkv5nxKETNj813oEM_dwfN-fFKDklgovC3I1Dk6e8b2fBx4px8C3lcZuySakVITENMNsPRprLTRQVFApsJlayp-4Ap4JeIZL9TjiMbsO0OCP5wcD_ZybHZzxdJBcA-AZ7Ecwjcc/s1600/header+settings1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="114" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZIrIyWkv5nxKETNj813oEM_dwfN-fFKDklgovC3I1Dk6e8b2fBx4px8C3lcZuySakVITENMNsPRprLTRQVFApsJlayp-4Ap4JeIZL9TjiMbsO0OCP5wcD_ZybHZzxdJBcA-AZ7Ecwjcc/s320/header+settings1.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgezzwk0V0fFEPJsIqhoLKCxQL7h1KA01KxeqBq1hi4uQL6QLf1rKT0_SNbLCWnbi09E0Q8ItagdgE2IqLu9c6sF_HjC2-T02sEd5l_S5QiolFyLCf8BZCE2M0PYpznL5hF53q3oxh5GpY/s1600/header+settings2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="114" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgezzwk0V0fFEPJsIqhoLKCxQL7h1KA01KxeqBq1hi4uQL6QLf1rKT0_SNbLCWnbi09E0Q8ItagdgE2IqLu9c6sF_HjC2-T02sEd5l_S5QiolFyLCf8BZCE2M0PYpznL5hF53q3oxh5GpY/s320/header+settings2.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwRO-K_GLlI_0KeW6ubz-ZxM8ELAQ85l4DLLf8PlsE0-WhbjO42qGG4hpcWk0exlrzJo7OjwfXkB0wk6Qp33wYqrmq9jMFrw3BX9cOeZALgi37NC3dY7OysYeRHSoPukWZoMWzbyjguuA/s1600/footer+settings.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="114" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwRO-K_GLlI_0KeW6ubz-ZxM8ELAQ85l4DLLf8PlsE0-WhbjO42qGG4hpcWk0exlrzJo7OjwfXkB0wk6Qp33wYqrmq9jMFrw3BX9cOeZALgi37NC3dY7OysYeRHSoPukWZoMWzbyjguuA/s320/footer+settings.png" width="320" /></a></div>
<br />
Here's the files used for this and their source code:<br />
<br />
<ul>
<li>theme-options.php - <a href="http://pastebin.com/rVnCQgzP">http://pastebin.com/rVnCQgzP</a></li>
<li>options-style.css - <a href="http://pastebin.com/q6VSgFAB">http://pastebin.com/q6VSgFAB</a></li>
<li>b4b-options.js - <a href="http://pastebin.com/zZYgx42p">http://pastebin.com/zZYgx42p</a></li>
<li>b4b-upload.js - <a href="http://pastebin.com/4q3UnngM">http://pastebin.com/4q3UnngM</a></li>
</ul>
<div>
I'm aware that I can just combine the two js files but I'm keeping them separate to stay a little more organized (I'll put them together and compress it when I finalize everything). I'm sure some things can be coded better but I'm moving on to the rest of the theme now and will come back for improvements after everything is done. That's all for today, pce!</div>
Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-48764073238148080072013-07-11T22:06:00.001-07:002013-07-11T22:06:45.046-07:00Back from college - wp options panel day 6I had college orientation and a bunch of other stuff to take care of which is why I was gone for so long. I my free time though I have been designing a new WordPress theme called Boundaries for Breaking. So far I've only designed it in Photoshop and it looks pretty good. When I code it it'll be named b4b and I need to re-size it because the design is a bit small. Since I haven't been learning about the settings api like I should have I'm going back to learning about it for most of today.<br />
<br />
Before I even get started with taking notes, I had to fix my localhost (wampserver) first. What was wrong with it? This was the error:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigMxsm46ETAg7cv-E1jZqx0kRwRgLlxEobHrkqFhnPRsO47d8MRS9LgLd0GDZvBNZCLVORU07FbWoxMhnYO7UFrkXfi4sb9-s9SzlQ-H6e5I-AIWYaSKFSoqf_m4WrPuib5nX3vdZGyYE/s1600/php_curl.dll+error.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="159" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigMxsm46ETAg7cv-E1jZqx0kRwRgLlxEobHrkqFhnPRsO47d8MRS9LgLd0GDZvBNZCLVORU07FbWoxMhnYO7UFrkXfi4sb9-s9SzlQ-H6e5I-AIWYaSKFSoqf_m4WrPuib5nX3vdZGyYE/s400/php_curl.dll+error.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I fixed it by following the advice from the first responders on these two threads:</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://stackoverflow.com/questions/10939248/php-curl-not-working-wamp-on-windows-7-64-bit">http://stackoverflow.com/questions/10939248/php-curl-not-working-wamp-on-windows-7-64-bit</a></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://forum.wampserver.com/read.php?2,114277,printview,page=1">http://forum.wampserver.com/read.php?2,114277,printview,page=1</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Okay back to note taking... So in this tutorial <a href="http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-4-on-theme-options/">http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-4-on-theme-options/</a> the author goes over categorizing all the fields in each section to a single option. Once you define multiple option sections and display them using settings_fields(), do_settings_sections() and submit_button() wrapped in a form only the newest defined option will actually save.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now for part 5, <a href="http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-5-tabbed-navigation-for-your-settings-page/">http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-5-tabbed-navigation-for-your-settings-page/</a>, he says you can keep these option groups and still save with using tabs instead of new pages. I only got to the very beginning of this tutorial before I ran into troubles and couldn't get anything working. The non-working code is here: <a href="http://pastebin.com/xVmuKjcc">http://pastebin.com/xVmuKjcc</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I'm back to this code now though cause it is still working: <a href="http://pastebin.com/3HLKhuQG">http://pastebin.com/3HLKhuQG</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I'm going to read through part 5 again and try to add tabs to my code even with only one set of options. Didn't add tabs still yet but added the image uploader by following and making modifications/additions to the code from these two tutorials:</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://wp.tutsplus.com/tutorials/creative-coding/integrating-the-wp-media-uploader-into-your-theme-with-jquery/?search_index=2">http://wp.tutsplus.com/tutorials/creative-coding/integrating-the-wp-media-uploader-into-your-theme-with-jquery/?search_index=2</a></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://www.webmaster-source.com/2013/02/06/using-the-wordpress-3-5-media-uploader-in-your-plugin-or-theme/">http://www.webmaster-source.com/2013/02/06/using-the-wordpress-3-5-media-uploader-in-your-plugin-or-theme/</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here's the code at the end of today: <a href="http://pastebin.com/c9U3gD0Z">http://pastebin.com/c9U3gD0Z</a></div>
<div class="separator" style="clear: both; text-align: left;">
Here's the additional js file: <a href="http://pastebin.com/ErZy47vc">http://pastebin.com/ErZy47vc</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Pce niggs.</div>
Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-45542293718888651282013-07-05T20:52:00.001-07:002013-07-05T20:53:10.420-07:00Options panel day 5 - wordpress menu typesOn part 3 of the settings api tutorials and this part goes over menu types (not the settings api but very closely related).<br />
<div>
<br /></div>
<div>
<b>Top-level menus: </b>are the menus in the left column that hold sub-menu pages. You use the add_menu_page function to add your own: <a href="http://codex.wordpress.org/Function_Reference/add_menu_page">http://codex.wordpress.org/Function_Reference/add_menu_page</a></div>
<div>
add_menu_page(Page Title, Menu Title, Capability, Menu Slug, Callback, Icon URL, Position);</div>
<div>
<ul>
<li>Page Title - Title displayed in the browser window tab.</li>
<li>Menu Title - Title displayed in the menu. Keep it short so it doesn't wrap and look stupid.</li>
<li>Capability - String value that specifies which users can access the menu. Roles: <a href="http://codex.wordpress.org/Function_Reference/add_menu_page">http://codex.wordpress.org/Function_Reference/add_menu_page</a></li>
<li>Menu Slug - identifier for the menu page. Is a hook that submenu pages use to register themselves.</li>
<li>Callback - function that defines content for the page. This can be html or refer to and external file.</li>
<li>Icon URL - path of the icon that gets displayed next to menu title. (optional)</li>
<li>Position - place in the menu where the page gets placed. It gets placed at the bottom by default but custom positioning allows you to put it above or below and existing item.</li>
</ul>
<div>
Use this function in a custom function you create that is hooked to the admin_menu. A lot of people think that the position argument is a bad practice cause it changes the traditional wordpress experience and the position can be overwritten if defined somewhere else.</div>
</div>
<div>
<br /></div>
<div>
<b>Submenus: </b>pretty much the same as a menu except they belong to top-level menus (they always have a parent). add_submenu_page is the function that is used for submenus: <a href="http://codex.wordpress.org/Function_Reference/add_submenu_page">http://codex.wordpress.org/Function_Reference/add_submenu_page</a></div>
<div>
add_submenu_page(Parent Slug, Page Title, Menu Title, Capability, Menu Slug, Callback);</div>
<div>
<ul>
<li>Parent Slug - ID of the menu item it will belong to.</li>
<li>Page Title - same as top-level.</li>
<li>Menu Title - same as top-level.</li>
<li>Capability - refers to what types of users can access the specific submenu page</li>
<li>Menu Slug - ID for this specific item.</li>
<li>Callback - same as top-level.</li>
</ul>
<div>
<b>Plugin Pages: </b>the add_plugins_page function was made to make it easier for plugin developers: <a href="http://codex.wordpress.org/Function_Reference/add_plugins_page">http://codex.wordpress.org/Function_Reference/add_plugins_page</a></div>
</div>
<div>
add_plugins_page(Page Title, Menu Title, Capability, Menu Slug, Callback);</div>
<div>
All of its parameters work the same as add_menu_page. This should be called from within your plugin's php file and not your functions.php.</div>
<div>
<br /></div>
<div>
<b>Theme Pages: </b>uses add_theme_page to add a submenu to the appearance menu: <a href="http://codex.wordpress.org/Function_Reference/add_theme_page">http://codex.wordpress.org/Function_Reference/add_theme_page</a></div>
<div>
add_theme_page(Page Title, Menu Title, Capability, Menu Slug, Callback);</div>
<div>
All of its parameters work the same as add_submenu_page.</div>
<div>
<br /></div>
<div>
Now what is each menu type good for exactly?:</div>
<div>
<ul>
<li>Top-Level Menus - for when you have a group of important settings that don't fit in other existing menus.</li>
<li>Submenus - either custom or already existing, should be put under a parent menu that works.</li>
<li>Plugin Menus - used for plugins and should used tabbed navigation if there's multiple option pages.</li>
<li>Theme Menus - used for theme options and follows the same deal with tabbed menus as plugin menus. However, top-level menus are sometimes used for theme options instead.</li>
</ul>
<div>
So that's everything I took down for part 3. Here's the code I'm left with at the end of that: <a href="http://pastebin.com/aYk6kjzX">http://pastebin.com/aYk6kjzX</a></div>
</div>
<div>
<br /></div>
<div>
Part 4 is supposed to go more into detail about theme options so I'm starting that now but that's all for this post.</div>
Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-52779344025148210902013-07-02T21:02:00.002-07:002013-07-02T21:02:45.082-07:00Options panel struggles continue - day 4Things aren't going so well creating an options panel. Today I learned that the method I've been using to create an options panel is outdated and that there's a settings api that I could be using instead: <a href="http://codex.wordpress.org/Settings_API">http://codex.wordpress.org/Settings_API</a><br />
<br />
When going through the tutorial (<a href="http://persteezy.blogspot.com/2013/06/creating-options-panel-day-3.html">in my last post</a>) I started picking up on this bit by bit. So for the rest of this post I'm taking down some notes on this settings api as I work my way through this tutorial series: <a href="http://wp.tutsplus.com/series/the-complete-guide-to-the-wordpress-settings-api/">http://wp.tutsplus.com/series/the-complete-guide-to-the-wordpress-settings-api/</a><br />
btw I'm starting the options panel from scratch now (but keeping theme-options.php) in a new file (better-options.php).<br />
<br />
So yea, this api is supposed to facilitate the processes of:<br />
<br />
<ul>
<li>introducing menus</li>
<li>option pages</li>
<li>saving (I'm looking forward to this lol)</li>
<li>validating</li>
<li>retrieving user input</li>
</ul>
<div>
You should use the api because it's secure and properly manages (my mistake).</div>
<div>
<br /></div>
<div>
There are three main components of the api:</div>
<div>
<ol>
<li>Fields - single inputs (options) that you'll see on menu pages like textboxes, radio buttons, selects, etc. They hold the value that gets put in the db.</li>
<li>Sections - are used for grouping (usually related) fields. Normally used so each section is its own menu page.</li>
<li>Settings get registered <b>after </b>you've defined your fields and sections.</li>
</ol>
<div>
Creating a section uses the add_settings_section function I learned about before: <a href="http://codex.wordpress.org/Function_Reference/add_settings_section">http://codex.wordpress.org/Function_Reference/add_settings_section</a></div>
</div>
<div>
add_settings_section(ID, Title, Callback, Page);</div>
<div>
<ul>
<li>ID - identifier for the section. The value is used in registering the field within each section and can be named anything (keep it meaningful).</li>
<li>Title - a value displayed at the top of the page as an (h1 or h3 or something).</li>
<li>Callback - the name of the function where the code for displaying certain elements for the section will go.</li>
<li>Page - this value tellswp which page your options are displayed on.</li>
</ul>
<div>
This is a reference for some page keys:</div>
</div>
<div>
<ul style="border: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; list-style: none; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="background-image: url(http://wp.tutsplus.com/wp-content/themes/tuts/images/global/li.gif); background-position: 0px 8px; background-repeat: no-repeat no-repeat; border: 0px; font-family: inherit; font-size: 14px; font-style: inherit; margin: 0px 0px 10px 5px; outline: 0px; padding: 0px 0px 0px 35px; vertical-align: baseline;">General, “general”</li>
<li style="background-image: url(http://wp.tutsplus.com/wp-content/themes/tuts/images/global/li.gif); background-position: 0px 8px; background-repeat: no-repeat no-repeat; border: 0px; font-family: inherit; font-size: 14px; font-style: inherit; margin: 0px 0px 10px 5px; outline: 0px; padding: 0px 0px 0px 35px; vertical-align: baseline;">Writing, “writing”</li>
<li style="background-image: url(http://wp.tutsplus.com/wp-content/themes/tuts/images/global/li.gif); background-position: 0px 8px; background-repeat: no-repeat no-repeat; border: 0px; font-family: inherit; font-size: 14px; font-style: inherit; margin: 0px 0px 10px 5px; outline: 0px; padding: 0px 0px 0px 35px; vertical-align: baseline;">Reading, “reading”</li>
<li style="background-image: url(http://wp.tutsplus.com/wp-content/themes/tuts/images/global/li.gif); background-position: 0px 8px; background-repeat: no-repeat no-repeat; border: 0px; font-family: inherit; font-size: 14px; font-style: inherit; margin: 0px 0px 10px 5px; outline: 0px; padding: 0px 0px 0px 35px; vertical-align: baseline;">Discussion, “discussion”</li>
<li style="background-image: url(http://wp.tutsplus.com/wp-content/themes/tuts/images/global/li.gif); background-position: 0px 8px; background-repeat: no-repeat no-repeat; border: 0px; font-family: inherit; font-size: 14px; font-style: inherit; margin: 0px 0px 10px 5px; outline: 0px; padding: 0px 0px 0px 35px; vertical-align: baseline;">Media, “media”</li>
<li style="background-image: url(http://wp.tutsplus.com/wp-content/themes/tuts/images/global/li.gif); background-position: 0px 8px; background-repeat: no-repeat no-repeat; border: 0px; font-family: inherit; font-size: 14px; font-style: inherit; margin: 0px 0px 10px 5px; outline: 0px; padding: 0px 0px 0px 35px; vertical-align: baseline;">Privacy, “privacy”</li>
<li style="background-image: url(http://wp.tutsplus.com/wp-content/themes/tuts/images/global/li.gif); background-position: 0px 8px; background-repeat: no-repeat no-repeat; border: 0px; font-family: inherit; font-size: 14px; font-style: inherit; margin: 0px 0px 10px 5px; outline: 0px; padding: 0px 0px 0px 35px; vertical-align: baseline;">Permalinks, “permalink”</li>
</ul>
<div>
The add_settings_field function gets used to ad fields: <a href="http://codex.wordpress.org/Function_Reference/add_settings_field">http://codex.wordpress.org/Function_Reference/add_settings_field</a></div>
</div>
<div>
add_settings_field(ID, Title, Callback, Page, Section, Arguments);</div>
<div>
<ul>
<li>ID - ID of the field and used in saving and retrieving the value (keep it meaningful).</li>
<li>Title - value that turns into the title of the field option on the page.</li>
<li>Callback - Same as in section.</li>
<li>Page - identifies which page the option should be on and can be added to an existing page rather than a section that's already been defined.</li>
<li>Section - the ID of the section you created earlier when registering sections. (optional param)</li>
<li>Arguments - array of arguments that get brought to the callback func. (optional param)</li>
</ul>
Now after you add some sections and fields they still will not save. Why? Because they weren't registered with the register_setting function yet: <a href="http://codex.wordpress.org/Function_Reference/register_setting">http://codex.wordpress.org/Function_Reference/register_setting</a></div>
<div>
register_setting(Option Group, Option Name, Callback);</div>
<div>
<ul>
<li>Option Group - Name of the group of options. This will be and existing group of options in wp or an ID that we made when we created our section. (required)</li>
<li>Option Name - The ID of the field we're registering. If registering multiple fields, you'd have to call this function multiple times. (required)</li>
<li>Callback - Same as section and field. (optional)</li>
</ul>
<div>
Now to use these options you created, the get_option function comes into play: <a href="http://codex.wordpress.org/Function_Reference/get_option">http://codex.wordpress.org/Function_Reference/get_option</a></div>
</div>
<div>
get_option(Option ID, Default Option);</div>
<div>
<ul>
<li>Option ID - the ID of the field that you want the value of. (required)</li>
<li>Default Option - the value if the option returns nothing (like if it didn't exist in the db). (optional)</li>
</ul>
<div>
Well that's all I'm going through for today. By applying all this knowledge (and the little programming skill I have), I've come up with this as my functions file: <a href="http://pastebin.com/ZkGkiMVP">http://pastebin.com/ZkGkiMVP</a></div>
</div>
<div>
<br /></div>
<div>
I've also applied these options to my themes header file: <a href="http://pastebin.com/FzBUbxF9">http://pastebin.com/FzBUbxF9</a></div>
<div>
<br /></div>
<div>
So this is what this code looks like:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqQwUtOwyYDYsEhC4MEY4NOfsdW1wxD_w-pMzcg7ic4hox1bqSH2EhZJFfe_0buiTpylHqdnBocE80qdPlad2X8At_Bx5aitHZDEduSwYuU5II7DV4nkL5fPlYveIetCnc_a8oYtK7a9Q/s805/options+panel.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="249" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqQwUtOwyYDYsEhC4MEY4NOfsdW1wxD_w-pMzcg7ic4hox1bqSH2EhZJFfe_0buiTpylHqdnBocE80qdPlad2X8At_Bx5aitHZDEduSwYuU5II7DV4nkL5fPlYveIetCnc_a8oYtK7a9Q/s320/options+panel.png" style="cursor: move;" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyYmXLA-lVuMMRusT55dGsbIpMeYJM5_j6BnzKFNagF3hJQ64oZtZGe30RCNYdV86cdxhJXTkql8V7BqbdpkI7IkXGJwfk6jmlWkIhCYO6pvbzhG1DeKLHJVs_eQ5tCkcv5-3sJGtJZAA/s252/options+panel+working.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyYmXLA-lVuMMRusT55dGsbIpMeYJM5_j6BnzKFNagF3hJQ64oZtZGe30RCNYdV86cdxhJXTkql8V7BqbdpkI7IkXGJwfk6jmlWkIhCYO6pvbzhG1DeKLHJVs_eQ5tCkcv5-3sJGtJZAA/s1600/options+panel+working.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
At the end of the day, I'm happy to finally be getting somewhere with the options panel without having to copy and paste massive amounts of code. With this settings api, I actually understand what's going on now so tonight I can go to sleep a little less pissed off than usual ;)</div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-85376264184855988312013-06-30T17:58:00.001-07:002013-06-30T17:58:58.542-07:00Creating an options panel - day 3Still no responses on the other thread so I'm creating a new one: <a href="http://wordpress.stackexchange.com/questions/104632/options-php-loop-wont-show">http://wordpress.stackexchange.com/questions/104632/options-php-loop-wont-show</a><br />
<br />
Already got some help and are narrowing everything down. Well I feel very stupid. I forgot to actually call the them_options function forth. To do so, all I had to do was add_action('init', 'theme_options'); which I knew already, I just kept missing it.<br />
<br />
Another problem occurred with the save button not working so I've posted a new question on it here: <a href="http://wordpress.stackexchange.com/questions/104734/theme-options-save-button-is-not-working">http://wordpress.stackexchange.com/questions/104734/theme-options-save-button-is-not-working</a><br />
<br />
I don't mean to rely on them for help but I've been struggling with it for a few hours now and are stuck.<br />
<br />
In the meantime, I'm taking written notes on the source code from this tutorial: <a href="http://wp.tutsplus.com/tutorials/creative-coding/how-to-integrate-the-wordpress-media-uploader-in-theme-and-plugin-options/">http://wp.tutsplus.com/tutorials/creative-coding/how-to-integrate-the-wordpress-media-uploader-in-theme-and-plugin-options/</a><br />
<br />
These are some of the functions I've learned about:<br />
<br />
<ul>
<li><a href="http://codex.wordpress.org/Function_Reference/add_option">http://codex.wordpress.org/Function_Reference/add_option</a></li>
<li><a href="http://codex.wordpress.org/Plugin_API/Action_Reference/after_setup_theme">http://codex.wordpress.org/Plugin_API/Action_Reference/after_setup_theme</a></li>
<li><a href="http://codex.wordpress.org/Function_Reference/add_theme_page">http://codex.wordpress.org/Function_Reference/add_theme_page</a></li>
<li><a href="http://codex.wordpress.org/Plugin_API/Action_Reference/admin_menu">http://codex.wordpress.org/Plugin_API/Action_Reference/admin_menu</a></li>
<li><a href="http://codex.wordpress.org/Function_Reference/_e">http://codex.wordpress.org/Function_Reference/_e</a></li>
<li><a href="http://codex.wordpress.org/Function_Reference/settings_errors">http://codex.wordpress.org/Function_Reference/settings_errors</a></li>
<li><a href="http://codex.wordpress.org/Function_Reference/settings_fields">http://codex.wordpress.org/Function_Reference/settings_fields</a></li>
<li><a href="http://codex.wordpress.org/Function_Reference/do_settings_sections">http://codex.wordpress.org/Function_Reference/do_settings_sections</a></li>
<li><a href="http://codex.wordpress.org/Function_Reference/register_setting">http://codex.wordpress.org/Function_Reference/register_setting</a></li>
<li><a href="http://codex.wordpress.org/Function_Reference/add_settings_section">http://codex.wordpress.org/Function_Reference/add_settings_section</a></li>
<li><a href="http://codex.wordpress.org/Function_Reference/add_settings_field">http://codex.wordpress.org/Function_Reference/add_settings_field</a></li>
</ul>
<div>
That's it for today.</div>
Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-66952988939576892922013-06-27T21:18:00.002-07:002013-06-27T21:18:59.098-07:00Working with the options panel - day 2/vent<br />
<br />
Today I'm just fucking stressed and annoyed. I can't even get the damn reset/save buttons to work fucking properly. Here's the current options.php: <a href="http://pastebin.com/2P31BgcW">http://pastebin.com/2P31BgcW</a><br />
<br />
Every time I hit the reset or save button I get "You do not have sufficient permissions to access this page". Now why wouldn't I? I'm the admin of the blog but I don't have permissions to save/reset the options apparently. This means something is up with my fuckinround_add_admin function.<br />
<br />
The thing in this function that I think is causing the error should be this guy: <a href="http://codex.wordpress.org/Function_Reference/check_admin_referer">http://codex.wordpress.org/Function_Reference/check_admin_referer</a><br />
<br />
But why? I can't find anything wrong with that.. So I'm going to continue looking aaaaaannnnnndddddd found it! It's the fucking header method causing the problem. I can't do options/options.php most likely because I can't view directories like that. If I just change it too options.php it appears to work fine.<br />
<br />
Although it appears to be working, it might not work at all when I actually write the loops and try to save the properties. So now I'm onto writing them...<br />
<br />
Well I've tried writing loop 1: <a href="http://pastebin.com/cK7APede">http://pastebin.com/cK7APede</a><br />
But nothing wants to show up on the page. Why? idk yet. If I do <b>echo <h1>test</h1>;</b> just outside of the foreach loop it works perfectly. However when I put this inside of the foreach loop it's a nogo. This means that (a) The options aren't declared properly (b) The options aren't declared before they are used (c) Something completely different than what I'm thinking is going wrong.<br />
<br />
Asked a question here regarding it: <a href="http://thematictheme.com/forums/topic/options-panel-loop-isnt-showing/">http://thematictheme.com/forums/topic/options-panel-loop-isnt-showing/</a><br />
Now I'm just awaiting a reply...<br />
<br />
Well, it's 12:20AM and there's still no replies and I'm tired as fuck so I guess this is where I end today.<br />
Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-18304119742476660122013-06-25T18:19:00.000-07:002013-06-25T18:19:13.342-07:00Creating an advanced options panel - day 1I just graduated recently and I've been too busy spending time with the fam and homies to actually post anything here. What I have done over this time was almost completely dissemble (till I took the motherboard out), get the dust out of, and assemble my Acer Aspire One 532h-2588. I used this guide to do so: <a href="http://erkinson.altervista.org/acer-aspire-one-532h-aggiornare-ramhdwifi-smontare-lcd/">http://erkinson.altervista.org/acer-aspire-one-532h-aggiornare-ramhdwifi-smontare-lcd/</a><br />
And no, I don't speak Italian, I translated the article (obviously). Everything was very easy to put back together except for the damn keyboard. The main reason was that the ribbon cable used to connect it was very folded and almost impossible to secure (but I got it).<br />
<br />
Today I've started creating an advanced options panel today. These are some of the guides I'm using so far:<br />
<br />
<ul>
<li><a href="http://net.tutsplus.com/tutorials/wordpress/how-to-create-a-better-wordpress-options-panel/">http://net.tutsplus.com/tutorials/wordpress/how-to-create-a-better-wordpress-options-panel/</a></li>
<li><a href="http://wp.tutsplus.com/tutorials/creative-coding/how-to-integrate-the-wordpress-media-uploader-in-theme-and-plugin-options/">http://wp.tutsplus.com/tutorials/creative-coding/how-to-integrate-the-wordpress-media-uploader-in-theme-and-plugin-options/</a></li>
<li><a href="https://forrst.com/posts/How_to_add_an_image_upload_select_button_to_Word-rik">https://forrst.com/posts/How_to_add_an_image_upload_select_button_to_Word-rik</a></li>
<li><a href="http://www.justinwhall.com/multiple-upload-inputs-in-a-wordpress-theme-options-page/">http://www.justinwhall.com/multiple-upload-inputs-in-a-wordpress-theme-options-page/</a></li>
</ul>
<div>
My idea is to have too loops in the creation of the panel. The first will be used to create a side navigation that is used for navigating through each container that has options in it (so it will only use the items in the array with the <i>sidebar</i> type. The second loop will be used to create the needed containers to go along with the side menu and fill them with options.</div>
<div>
<br /></div>
<div>
Once this is done, I'll need to write some simple js to fade in and out of containers depending on the one clicked in the side menu. As for the save changes input functions, I think I can just copy/paste it from either the first article above or just rewrite it from one of the books I own. This is all I'm posting about now but I'm going to continue working throughout tonight.</div>
<div>
<br /></div>
<div>
My goal is to make it look almost exactly like this:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM-B8eNw_OfY6ObSjlSm-qPSbKNi__W8zZHMXnyMdJCObnCo6X4G3xGfAWt43u6gr9b4tpkI74wSIIFIFREQxOGMq1cN_nZr1eFYcl-Gi-RYzX64_EOykneyfPbslBQ-04cbBjB7lcvGM/s1600/options+example.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="306" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM-B8eNw_OfY6ObSjlSm-qPSbKNi__W8zZHMXnyMdJCObnCo6X4G3xGfAWt43u6gr9b4tpkI74wSIIFIFREQxOGMq1cN_nZr1eFYcl-Gi-RYzX64_EOykneyfPbslBQ-04cbBjB7lcvGM/s400/options+example.png" width="400" /></a></div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-62618860232549139232013-06-19T22:27:00.001-07:002013-06-19T22:27:07.746-07:00Integrating WP Plugins/Widgets into your themeTonight I'm trying to figure out how to integrate widgets I write into my theme. This way, when the user install the theme, the widgets will be there for them to use.<br />
<br />
<b><span style="color: #d0e0e3;">To do so you just need to:</span></b><br />
<br />
<ul>
<li>import all the widget files into your theme directory</li>
<li>Make sure any hardcoded paths or plugin_urls are changed to get_template_directory_uri() and the correct path.</li>
<li>Add a require_once to your functions.php with the path of your widget's php file inside.</li>
</ul>
<div>
<b><span style="color: #d0e0e3;">Notes:</span></b></div>
<div>
<ul>
<li>When integrating make sure to delete it from the plugins directory or else you'll get an error that says you can't redefine that class.</li>
</ul>
<div>
Now that I have shortcodes and integrating plugins/widgets into the theme I can now start working on making an advanced admin panel. This admin panel would include the following options:</div>
</div>
<div>
<ul>
<li>Change logo/if you want a logo at all.</li>
<li>Change background image/color.</li>
<li>Change link color.</li>
<li>Change header text color.</li>
<li>Custom css.</li>
<li>Insert google analytic code.</li>
<li>Enable/disable image slider.</li>
<li>Enable/disable jQuery.</li>
</ul>
<div>
All of these need to be placed in a tab for their category of option in the options panel too. That's all for tomorrow night though cause tonight's energy drink is wearing off already.</div>
</div>
Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-42459029877644576492013-06-17T11:00:00.001-07:002013-06-19T21:34:25.643-07:00ConversionIt's been a while since I posted because of four reasons:<br />
<ul>
<li>laziness</li>
<li>social life</li>
<li>new conversion</li>
<li>finals :(</li>
</ul>
<div>
Anyways, I did a new psd to html conversion called **** Host. It's a three page web hosting layout that I used as much css3 as possible on:<br />
<br />
<b style="color: magenta;">EDIT: </b>The design I coded was apparently ripped from another designer. I feel bad about doing this so I've removed all the pictures of the coded design etc. It's amazing how many fag rippers are on the internet these days.</div>
Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-80071937518967746942013-06-11T21:51:00.001-07:002013-06-11T21:51:38.290-07:00vbulletin skins?I spent majority of my time on the computer today derping around. Other than that I decided to take a break from wp and check out how vbulletin skins work. These two sites help with understanding how a skin works:<br />
<ul>
<li><a href="http://www.vbulletin.org/forum/showthread.php?t=124576">http://www.vbulletin.org/forum/showthread.php?t=124576</a></li>
<li><a href="http://www.vbulletin.com/docs/html/main/stylesintro">http://www.vbulletin.com/docs/html/main/stylesintro</a></li>
</ul>
<div>
I can only read and not actually try this stuff out today because I don't have a nulled vbulletin to run on my localhost and TPB is down for whatever reason. I don't trust the torrents from other sites either like torrentz.eu and kickass torrents. The thing that makes me nervous about downloading so many things is opening a virus and having all my account data stolen. Sometimes when I'm really paranoid, I convince myself that I already have a virus and go crazy with scans/checking folders/processes where it could possibly be. It'd probably be a good idea to ask the experienced members on HF if my comp is infected because I feel my paranoia coming in again. </div>
Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0tag:blogger.com,1999:blog-1066368419736739360.post-17930815558614268872013-06-10T21:55:00.001-07:002013-06-10T21:55:26.591-07:00My progress with shortcodes<div class="separator" style="clear: both; text-align: left;">
Tonight I messed around with shortcodes more so they look like this:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCStAjTlTAIGu_l2P0VopbeH94ZQ-LG0_H6FFWZPqej1gUVemMuOlyq022a63ZMKKM9JrHgwik6NhKWV0D8lVPyr3jFJWRmOhPvw6YxgwfG9RqnKdK3V3JElXdicEJFEscQOafZ21F9m4/s1600/shortcodes.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCStAjTlTAIGu_l2P0VopbeH94ZQ-LG0_H6FFWZPqej1gUVemMuOlyq022a63ZMKKM9JrHgwik6NhKWV0D8lVPyr3jFJWRmOhPvw6YxgwfG9RqnKdK3V3JElXdicEJFEscQOafZ21F9m4/s400/shortcodes.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr0AMuTsMVZraHgBdImK9UBQl421zXeoN4er4VYECNMDcc1EXBlPxnP1TmI7dp1f_bIOEfnyH1IIwdQs3T2ZQXSEMbqvOz7jSMk3nIogGGyzgc-FskPzvECVGBcSbatmL1pO9O1aGH7Hg/s1600/shortcodes+live.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr0AMuTsMVZraHgBdImK9UBQl421zXeoN4er4VYECNMDcc1EXBlPxnP1TmI7dp1f_bIOEfnyH1IIwdQs3T2ZQXSEMbqvOz7jSMk3nIogGGyzgc-FskPzvECVGBcSbatmL1pO9O1aGH7Hg/s400/shortcodes+live.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Some things I should probably do is make it so when the inline toggles are next to each other, the ones on the end will get the .last class and float:left;clear:right;. I want the same to happen for the alerts. I should also make it so when the width is fixed that they should clear:both;. A style attribute for all the elements wouldn't hurt either. When all this is complete it'd be a good idea to look into packaging this. Nothing else happened today besides a shit ton of calculus so pce.</div>
Anonymoushttp://www.blogger.com/profile/08478540017817305172noreply@blogger.com0