User Name
Password
AppleNova Forums » Programmer's Nook »

The WordPress Thread


Register Members List Calendar Search FAQ Posting Guidelines
The WordPress Thread
Page 2 of 8 Previous 1 [2] 3 4 5 6  Next Last Thread Tools
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2006-02-23, 20:40

Oooh, just had a thought.
If I specify the code you suggest in my template-functions-post.php:
Code:
<?php the_content('Read More...<img src="<?php echo $hotlink ?>" alt="read more" title="Read More..." />'); ?>
And assuming that the inner PHP works, it would have to be used in EVERY post... in otherwords...

What if I don't want to post a photo in an article? I'd still have to post a key value that points to a transparent spacer image in EVERY post just to prevent a missing image from displaying. Still, I haven't played with all the little things in my WRITE panel,

And why don't I see the Quicktag markup bar like everyone else does? Hrmmm.

Steve Jobs ate my cat's watermelon.
Captain Drew on Twitter
  quote
torifile
Less than Stellar Member
 
Join Date: May 2004
Location: Durham, NC
Send a message via AIM to torifile  
2006-02-23, 22:43

Quote:
Originally Posted by drewprops
Oooh, just had a thought.
If I specify the code you suggest in my template-functions-post.php:
Code:
<?php the_content('Read More...<img src="<?php echo $hotlink ?>" alt="read more" title="Read More..." />'); ?>
And assuming that the inner PHP works, it would have to be used in EVERY post... in otherwords...

What if I don't want to post a photo in an article? I'd still have to post a key value that points to a transparent spacer image in EVERY post just to prevent a missing image from displaying. Still, I haven't played with all the little things in my WRITE panel,
I don't think it will UNLESS you add a custom field. When the post is processed, php will check to see if $hotlinkimage is set. If so, it'll go through that part of the logic. If not, it'll just skip it.

Quote:
And why don't I see the Quicktag markup bar like everyone else does? Hrmmm.
Use something other than Safari. I only see it in FF.
  quote
torifile
Less than Stellar Member
 
Join Date: May 2004
Location: Durham, NC
Send a message via AIM to torifile  
2006-02-23, 22:48

Something like this ought to work. Again, my php skillz are lacking, so it might be syntaxtically correct.
Code:
if (isset($hotlinkimg)) { <?php the_content('Read More...<img src="<?php echo $hotlink ?>" alt="read more" title="Read More..." />'); ?> } else { <?php the_content('Read More...' ) ?> }
  quote
Wickers
is not a kind of basket
 
Join Date: May 2004
 
2006-02-23, 23:01

I know it's a force of habbit for some of you, but there's BB code for php.

(php) code here (/php)
switch ( and ) with [ and ] of course.

Unless you people don't like using that feature? I personally love syntax highlighting.

[php]
if (isset($hotlinkimg)) {
<?php the_content('Read More...<img src="<?php echo $hotlink ?>"
alt="read more" title="Read More..." />'); ?>
}
else {
<?php the_content('Read More...' ) ?>
}
[/php]

no sig, how's that for being a rebel!
  quote
torifile
Less than Stellar Member
 
Join Date: May 2004
Location: Durham, NC
Send a message via AIM to torifile  
2006-02-23, 23:07

Quote:
Originally Posted by Wickers
I know it's a force of habbit for some of you, but there's BB code for php.

(php) code here (/php)
switch ( and ) with [ and ] of course.

Unless you people don't like using that feature? I personally love syntax highlighting.

[php]
if (isset($hotlinkimg)) {
<?php the_content('Read More...<img src="<?php echo $hotlink ?>"
alt="read more" title="Read More..." />'); ?>
}
else {
<?php the_content('Read More...' ) ?>
}
[/php]
Thanks. I didn't even realize we had special php tags.
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2006-02-23, 23:10

Got to this late, too tired to try it tonight and can't do it from work... will try it later this w/e.

I taught myself PHP writing everything in PHP so it was weird getting used to the intermittent pockets of PHP you see in WordPress. Your code should be like this:

[PHP]
<?php
if (isset($hotlink)) {
the_content('Read More...<img src="$hotlink"
alt="read more" title="Read More..." />');
}else{
the_content('Read More...' );
}
?>
[/PHP]

But I'd have to experiment with it to be sure.... look forward to trying it out. I've already made so many neat tweaks to the site that I wish I could've waited to roll it out to my friends until now, but that's like waiting for the faster/cheaper computer to finally arrive.

Steve Jobs ate my cat's watermelon.
Captain Drew on Twitter
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2006-02-26, 12:24

Well Tori, I went and looked into Using Custom Fields in WordPress and it seems to be a rich area waiting for someone to leverage it to their advantage.. now, I don't think that it's as easy as just citing the $key in your code though. Apparently, WP creates a new mySQL table to store meta data for each post using custom fields. Read that link for more OR.....

Check out the Get Custom Field Values plugin which MAY solve my desire to make an image work as a link to the full post.

I did some experimenting today and got pretty close!!
First, I created a new custom field whose KEY was named "articleImage".
I picked a post with a picture in it and assigned a value to the articleImage key (the value was the remainder of the filepath and the name of the image I wanted to use ("2006/image.jpg").

Then I inserted the following code into the ARCHIVES portion of my code for The Loop:

[PHP]
<?php // BEGIN TRIAL CODE FOR INSERTING HYPERLINK PICTURE INTO ARTICLE PREVIEW ?>
<?php if(get_post_custom_values('articleImage')){
foreach(get_post_custom_values('articleImage') as $value) { ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
<img class="featureImage" src="graphics/article_photos/<?php echo $value; ?>" alt="<?php the_title(); ?>" />
</a>
<?php } ?>
<?php } ?>
<?php //END TRIAL CODE FOR INSERTING HYPERLINK PICTURE INTO ARTICLE PREVIEW ?>
[/PHP]

I inserted that code just before this code:

[PHP]
<div class="entry">
<!--insert code listed above into this space-->
<?php the_content('Read entire article &raquo;'); ?>
</div>
[/PHP]

And it works!!
The image displays, it works as a hotlink to the main article and looks terrific!!!!!!!

HOWEVER...

The problem I've discovered is that when the_content() spools out my article text it wraps my article text with paragraph tags
Code:
<p></p>
. So, regardless of the CSS that I apply to the image, it can't be "wrapped" by the article text (as it currently is in my default skin) because it's not INSIDE of the paragraph with the post's text.

Take a look at the test post in question (the one about "Turner Developing New Dr. Who Series?"):
http://www.drewprops.com/?m=200507

See how the picture isn't wrapped?

If I knew where WP spools out the article text, wrapping it in paragraph tags, I could insert the above code into that function but I'm not sure I want to go mushing around in the functions...

Any of this make sense?

Steve Jobs ate my cat's watermelon.
Captain Drew on Twitter

Last edited by drewprops : 2006-02-26 at 14:42.
  quote
torifile
Less than Stellar Member
 
Join Date: May 2004
Location: Durham, NC
Send a message via AIM to torifile  
2006-02-26, 15:51

Yeah, I see what you're talking about. But you're getting there. I'm sure it can be done.
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2006-02-28, 22:38

Found it.
Vaam Yob has a plugin called "self_image" that does exactly what I need! All I have to do is wrap the image with specific comment tags like so:

Code:
<!--self_img--><img src="graphics/image.jpg"/><!--/self_img-->
Very easy!

Steve Jobs ate my cat's watermelon.
Captain Drew on Twitter
  quote
torifile
Less than Stellar Member
 
Join Date: May 2004
Location: Durham, NC
Send a message via AIM to torifile  
2006-02-28, 22:47

Quote:
Originally Posted by drewprops
Found it.
Vaam Yob has a plugin called "self_image" that does exactly what I need! All I have to do is wrap the image with specific comment tags like so:

Code:
<!--self_img--><img src="graphics/image.jpg"/><!--/self_img-->
Very easy!
Sweet. My only big complaint with wordpress is the codex, honestly. There needs to be an easier way to find things like this. When I was first setting up my site, I had to use google to search for wordpress questions - more often than not the answer was right on wordpress.org, but their search engine couldn't find it.
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2006-04-13, 20:27

I am, in fact, having a terrible time with The Codex.

I'm working on an update to my pirate site, which I've made over completely with WordPress. I have another user that I'd like to enable as an "author" and to have one page be able to load with his posts, but I don't know how to write a page that is coupled with a single author (other than myself, the be-all "everything" of the WP site).

So you probably can't tell that I have stripper perfume all over me, or that I've had several large bottles of Asahi and several small bottle of Miller Lite, but I have.

And the Codex sucks for finding things that I'm looking for, like specifying specific authors with WP code.

Man, stripper perfume really hangs with you.

Steve Jobs ate my cat's watermelon.
Captain Drew on Twitter
  quote
Majost
monkey with a tiny cymbal
 
Join Date: Nov 2004
Location: Lost
 
2006-04-13, 21:08

What are you trying to do? Load a page with just a certain author's posts?

Would the author archive view work for that? It's just www.yoursite.com/author/username/ if you use permalinks or probably www.yoursite.com/?author=username if you don't.

There are ways around getting the big AUTHOR ARCHIVE FOR USERNAME. They're a little more indepth, but I did it, and would be able to tell you how.
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2006-04-14, 07:57

That's exactly what I'm trying to do, load a page with a certain author's posts. Using the author archive is dead easy! But now that I've studied this some I realize that I want to limit the categories to which a certain author is allowed to post, I just want them to be able to post in a single category and right now they have the ability to post to all open categories.

I see an easy solution: since I have to approve all posts by authors before their posts go "live" I can reassign the author's selected category before publishing their post, but I'm now curious as to whether I can "turn off" categories for authors before they even begin typing.

Steve Jobs ate my cat's watermelon.
Captain Drew on Twitter
  quote
Majost
monkey with a tiny cymbal
 
Join Date: Nov 2004
Location: Lost
 
2006-04-14, 10:27

Glad to hear. That was easy

As far as limiting authors to certain categories, that would take hacking the write page in some crazy way... or creating/finding a plugin that does it. I wouldn't know where to begin, that's for sure!
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2006-04-15, 22:42

Turns out that there's a Plugin called (interestingly enough) "Limit Categories".
Picked up v.1.5.2 at http://www.asymptomatic.net/
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2006-04-19, 22:14

Akismet.
A marvelous plug-in that helps you catch comment spam.
The only trick is, you have to go sign up for a wordpress.com account to get your API key, which you can then run off and use with your self-installation. It seems so wasteful to sign up for a WP account that you're never going to use, even more so when you've just brought a second WP website online and want to use Akismet with that second site. My dilemma is whether to try using the same key from the first installation or to go and sign up for a second wordpress.com account that I'll never, ever log into again just for a key....

Any thoughts out there? I didn't see this in the FAQ on the official Akismet site....

Steve Jobs ate my cat's watermelon.
Captain Drew on Twitter
  quote
Majost
monkey with a tiny cymbal
 
Join Date: Nov 2004
Location: Lost
 
2006-04-19, 23:32

Hmm... I *think* I'm running multiple blogs with the same API. It's been a while since I've set them all up. I really don't think they care... it's just a way of tracking users, isn't it?
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2006-05-03, 21:49

How important is Technorati to making a website seen?

Do any of you WordPress users have a plug-in installed to create Technorati tags for individual articles? I'd like to add tags to my posts like I've done with Flickr. I need something simple and this thing called "SimpleTags" looks like the ticket.

Any thoughts on Tags and such?

Steve Jobs ate my cat's watermelon.
Captain Drew on Twitter
  quote
torifile
Less than Stellar Member
 
Join Date: May 2004
Location: Durham, NC
Send a message via AIM to torifile  
2006-05-03, 22:04

I use marsedit to post and you can define your technorati tags there. I don't like that you can't automatically a specific style to your tags without adding the code yourself but it's on their wish list for the next update.
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2006-05-04, 19:31

Man, I can't get over your new screen name.... hehehe
Oh, and I say Shut The F*** Up Tori whenever I hit CTRL-S ~!~!!!!
  quote
torifile
Less than Stellar Member
 
Join Date: May 2004
Location: Durham, NC
Send a message via AIM to torifile  
2006-05-04, 22:31

Quote:
Originally Posted by drewprops
Man, I can't get over your new screen name.... hehehe
Oh, and I say Shut The F*** Up Tori whenever I hit CTRL-S ~!~!!!!
I have a tough time logging in - I always forget to use this new name. I'm going to ask them to change it. I get confused when I look for my previous posts. STFU torifile!

  quote
Jason
Veteran Member
 
Join Date: Oct 2004
 
2006-05-11, 14:19

I've been having trouble with Safari reading my site in RSS.
Therefore, I backed up my Database and made a complete new install.
However, clicking on the RSS badge still results in the following error:

http://jasonnewton.net/wordpress_rss_error.png

I haven't even reinstalled my database yet. Why is this error coming up?
The site itself is here: http://www.jasonnewton.net/

Any help/suggestions greatly appreciated.

Kind Regards
  quote
Jason
Veteran Member
 
Join Date: Oct 2004
 
2006-06-04, 16:31

I recently installed the Flickr Plugin Falbum and think it is great.
I'm just using a standard Kubrick layout but for some reason the layout beneath the photos in the sidebar is screwed on Firefox. It is ok on IE and Safari.



No matter what I place below it, the next set of links in <li>some link</li> drifts off the page.
What really bothers me is that the following <li>some link</li> section is ok.
The page is also XHTML compliant.

I guess this is a css issue but where to start?
  quote
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2006-06-04, 16:47

Quote:
Originally Posted by Jason
I recently installed the Flickr Plugin Falbum and think it is great.
I'm just using a standard Kubrick layout but for some reason the layout beneath the photos in the sidebar is screwed on Firefox. It is ok on IE and Safari.



No matter what I place below it, the next set of links in <li>some link</li> drifts off the page.
What really bothers me is that the following <li>some link</li> section is ok.
The page is also XHTML compliant.

I guess this is a css issue but where to start?
Phew. That took a while to figure out.

The problem is with your float: left; statement in the falbum-thumbnail class, which you apply to every single Flickr image. This will make the del.icio.us list (or whatever other <li> is next) try and shift to the right of the last thumbnail.

Give the last thumbnail a different class, like: <div class="falbum-thumbnail-last">, and in this class, simply leave out the float: left; line, like:
Code:
.falbum-thumbnail { float: left; background: url('images/shadow.gif') no-repeat bottom right; margin: 5px 0px 0px 6px; padding: 0px 0px 0px 0px; } .falbum-thumbnail-last { background: url('images/shadow.gif') no-repeat bottom right; margin: 5px 0px 0px 6px; padding: 0px 0px 0px 0px; }
  quote
Jason
Veteran Member
 
Join Date: Oct 2004
 
2006-06-04, 17:47

Well, the CSS is easy enough but the <DIV> classes that are written in are a little more difficult. How do I tell PHP to create a new <div>

[PHP]$output .= "<div class='falbum-thumbnail'>";
}

$thumbnail = FALBUM_FLICKR_URL_IMAGE."/{$server}/{$photo_id}_{$secret}_".$size.".jpg"; // Build URL to thumbnail

if ($tags != '') {
$output .= "<a href='".$this->create_url("tags/$tags/page/$page/photo/$photo_link/")."'>";
} else {
$output .= "<a href='".$this->create_url("show/recent/page/$page/photo/$photo_link/")."'>";
}

$output .= "<img src='$thumbnail' alt=\"".htmlentities($photo_title)."\" title=\"".htmlentities($photo_title)."\" class='falbum-recent-thumbnail' />";
$output .= "</a>\n";
if ($style == 0) {
$output .= "</li>\n";
} else {
$output .= "</div>\n";
}
}[/PHP]

  quote
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2006-06-04, 17:51

Ah, yeah, that's a little more complicated. Where do you specify how many thumbnails get displayed?
  quote
Jason
Veteran Member
 
Join Date: Oct 2004
 
2006-06-04, 17:56

This is what is called in my Sidebar.

[PHP]<?php echo $falbum->show_random(4,'',1,'s');?>[/PHP]
  quote
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2006-06-04, 18:01

So it's gotta have some internal iterator somewhere. Only where?

Let's try something:

After
Code:
$output .= "<div class='falbum-thumbnail'>";
, try adding
Code:
$falbum_iterate_test++; $output .= "<!-- ".$falbum_iterate_test." -->";
Now, when you run it, for each thumnbail, you should get a part that looks like <!-- number -->, where number should go from 1 to 4. If it's always 1, this is not gonna work.
  quote
Jason
Veteran Member
 
Join Date: Oct 2004
 
2006-06-04, 18:11

This is what I now get:

Code:
<li><div class='falbum-random'> <div class='falbum-thumbnail'><!-- 1 --><a href='/wp-content/plugins/falbum/wp/album.php?show=recent&amp;page=1&amp;photo=159916815'><img src='http://static.flickr.com/59/159916815_eaa13d39ae_s.jpg' alt="L1000631" title="L1000631" class='falbum-recent-thumbnail' /></a> </div> <div class='falbum-thumbnail'><!-- 2 --><a href='/wp-content/plugins/falbum/wp/album.php?show=recent&amp;page=2&amp;photo=160279723'><img src='http://static.flickr.com/53/160279723_5bfc6839bf_s.jpg' alt="L1000563" title="L1000563" class='falbum-recent-thumbnail' /></a> </div> <div class='falbum-thumbnail'><!-- 3 --><a href='/wp-content/plugins/falbum/wp/album.php?show=recent&amp;page=2&amp;photo=160267420'><img src='http://static.flickr.com/45/160267420_ef99881419_s.jpg' alt="L1000517" title="L1000517" class='falbum-recent-thumbnail' /></a> </div> <div class='falbum-thumbnail'><!-- 4 --><a href='/wp-content/plugins/falbum/wp/album.php?show=recent&amp;page=1&amp;photo=159950463'><img src='http://static.flickr.com/71/159950463_0794939920_s.jpg' alt="L1000669" title="L1000669" class='falbum-recent-thumbnail' /></a> </div> </div> </li>
  quote
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2006-06-04, 18:14

Good! That's what I wanted.

Now, move the line
Code:
$falbum_iterate_test++;
above
Code:
$output .= "<div class='falbum-thumbnail'>";
(instead of below).

Then, replace the line
Code:
$output .= "<div class='falbum-thumbnail'>";
with the following:
Code:
if ($falbum_iterate_test < 4) {$output .= "<div class='falbum-thumbnail'>";} else {$output .= "<div class='falbum-thumbnail-last'>";}
And remove the line
Code:
$output .= "<!-- ".$falbum_iterate_test." -->";
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Page 2 of 8 Previous 1 [2] 3 4 5 6  Next Last

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
Cum sEE my SiLLy tHreaD and mOCK mE 4 it!!!1!1! chaos123x Speculation and Rumors 90 2006-10-05 13:22
The Official Dating Commentary™ Thread ShadowOfGed AppleOutsider 63 2006-05-08 10:13
Validating CSS from Wordpress Jason Programmer's Nook 7 2005-11-21 21:13


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 01:01.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova