deko
Forum Replies Created
-
Forum: Plugins
In reply to: style.css and images folder – where should they go?Yes, the less coding the better, to be sure. That’s a good point.
So I think my (c) idea is the winner – just reference two stylesheets in the non-wp pages – with
public_html/my-style.csscontaining only unique directeives for non-wp pages – and centralizing the images folder (all images, both wp and non-wp) in the site’s root.Thanks for the help 🙂
Forum: Plugins
In reply to: style.css and images folder – where should they go?hmmm… maybe having two stylesheets is not so bad.
Whatever is unique to non-wp pages can go in
/public_html/my-style.css(as joshziman suggested), and I just reference two sytlesheets in my non-wp pages.As for the images folder, I think I’m going to centralize it. This means hard-coding a path rather than using
<?php bloginfo('stylesheet_directory'); ?>but so what…
Forum: Plugins
In reply to: style.css and images folder – where should they go?The problem is redundancy. Repeated code is always a bad idea.
But I’m still thinking about this.
(I’m anticipating someone suggesting using Pages instead of non-wp pages, but that’s not a solution: I need non-wp pages on this site.)
In any case,
If I (a) point to the default wp locations for images and style there is less hacking (which is good).
But my theme is custom anyway – so why not (b) point wp-content to a central
public_html/imagesandpublic_html/style.css… this way my site is not so tightly coupled (which is bad) with wp…Forum: Plugins
In reply to: How to customize Pages template?Ah, I see… use the drop-down to select a page template.
more to learn… 🙂
I’ll figure it out.
It would be nice if WP shipped with a few (no more than 3) different page templates (each with some minor difference in appearence). So users would see the 3 different selections in the drop-down, and could hack each template with impunity.
Anyway, thanks for the tip!
Forum: Plugins
In reply to: How to customize Pages template?That “little bit of work” is largely discovery since I’m relatively new to WP (but fairly well-versed in CSS, PHP and HTML).
Can you give me a hint on how I can create Pages based on different templates?
I was successful in changing a couple of lines in page.php:
For example:
entrytopage-entryand commenting outlink_pages:<div class="page-entry">
<?php the_content('<p class="serif">Read the rest of this page »
'); ?>
<?php //link_pages('<strong>Pages:</strong> ', '
', 'number'); ?>
</div>Forum: Plugins
In reply to: How to customize Pages template?Page.php is indeed the file to modify. For starters, I commented out get_sidebar and link_pages.
But I’ll need to make some CSS mods – because the_content of a Page is generated in the same way as a post.
But if I want a custom nested ordered list, for example, I have to change the behavior of BOTH regular posts AND the Page – because
<ol>is redefined in the.entryclass.Nesting another class will not work here. So I’ll need something like a
<page-entry>class…developing…
Forum: Plugins
In reply to: WYSIWYG editorsI was once looking for a better wysisyg editor. I even purchased one (WysiwygPro by ViziMetrics). But I soon realized that the best option is not to use an editor at all.
Once you get used to WP’s html editor you’ll wonder why you ever used a wysiwyg editor.
Do yourself a favor and drop wysiwyg like a piece of used dental floss.
Forum: Fixing WordPress
In reply to: How to add code/html/whatever next to links?You’ll need more than a tiny script.
When someone clicks a link to download a song, you’ll need a way to record that download – and persist it to either a flat file or a database to keep count. Then, you’ll need another script to get a total for the display between the brackets.
Example:
Cog in the Wheel [329 downlaods]
‘Cog in the Wheel’ needs to be a link that passes a variable (to identify which song is being downloaded) to a script something like this:
<?php
$filename = ($_GET[song]);
$dlfile = "/home/username/cgi-bin/dl-count/".$filename;
header("Content-Disposition: attachment; filename=".$filename);
header("Content-Length: ".filesize($dlfile));
readfile($dlfile);
$counter_file = "/home/username/cgi-bin/dl-count/downloads.txt";
$filelock = "/home/username/cgi-bin/dl-count/file-lock.txt";
$got_it = false;
$timeout = 10;
$fp = fopen($counter_file,"a");
$timestamp = time();
$hourdiff = "0"; //0 = same time zone
$timeadjust = ($hourdiff * 60 * 60);
while (($got_it === false) && ($timeout != 0))
{
if (flock($fp, LOCK_EX))
{
fwrite($fp, $timestamp."|".$filename."n");
flock($fp, LOCK_UN);
$got_it = true;
}
else
{
usleep(100000);
--$timeout;
}
}
if (!$got_it)
{
$fplock=fopen($filelock, 'a');
fwrite($fplock,date("M d Y h:i a",time() + $timeadjust)."|".$counter_file."n");
fclose($fplock);
fclose($fp);
exit;
}
fclose($fp);
?>The above script records each download, in the form of a timestamp, to a file.
If you use this, then you’ll need another script that counts the timestamps for each song and puts the totals in variables that can be used like this:
Cog in the Wheel [ <$php echo $dl-cog; ?> downloads ]
You could do this in a loop if you have several songs.
I haven’t provided an example of the second script because my beer is getting warm. But, yes, it is possible.
Forum: Installing WordPress
In reply to: Help needed redirecting old urls .htaccess/ReWriteRuleif you want everyone going to oldsite.com to be sent to newsite.com, you could use this:
RewriteEngine on
Options All -Indexes
RewriteCond %{HTTP_HOST} ^www.oldsite.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^oldsite.com$ [NC]
RewriteRule ^(.*)$http ://www.newsite.com/index.html(space goes on other side of http… )
so, anyone who has a shortcut pointing to (or types in the address window) ‘oldsite.com’ will arrive at newsite.com
is this what you’re trying to do?
Forum: Plugins
In reply to: Widgets being added to WordPress coreI hope not as well. Wiggets are Plug-in material.
Let’s hope the WP folks keep the core simple, efficient, bug-free and secure.
Forum: Everything else WordPress
In reply to: Looking To “Hire” Someone To Create Custom ThemeHere’s some free advice: drop the Flash
Forum: Fixing WordPress
In reply to: 2.0.3 shows as 2.0 in Admin footer@handysolo – yes, I understand. But you see how that message is misleading? I think “Click here to nurp your installation” would have been easier to understand. 🙂
Forum: Fixing WordPress
In reply to: Why /’upgrade/’ to 2.0.3?It’s nice to have that patch from Mark Jaquith, but the WP folks should deal with this. Either post instructions on how to modify the broken code or release 2.0.4.
I’ve successfully installed it at this point.
Forum: Fixing WordPress
In reply to: 2.0.3 shows as 2.0 in Admin footerI think the idea of “upgrade the database” is misleading.
Does this mean I have to upgrade MySql?
Forum: Fixing WordPress
In reply to: endless loop problem with upgrade to 2.0.3I had to wrestle with it, but got it fixed… thanks.