where to fin myhack.php
-
Is the myhack.php file already in the wordpress package or is that something I need to make myself? If so, in which wordpress folder should I put the myhack.php file? Thanks.
-
add that to wiki podz 🙂
If you insist 🙂
http://wiki.wordpress.org/index.php/my-hacks.phpI’ve been trying to install Jon’s “new post email notification” hack. Would I just paste his php in between the <?php and ?> ? Or is there some other method? (Sorry. He didn’t provide documentation.) So far I’ve just gotten error codes, or the whole blog turns into “Sorry, I can’t do that Dave.”
That should work, yes…. but I don’t use that hack, so I can’t be certain of other changes needed.
Just to check:
I’m working on the get-authors hack. and this is what my my-hacks.php file look
like. Is this correct?
<? php
Press Return twice
<?php
#require_once(ABSPATH . ‘wp-hilite.php’);
add_filter(‘the_content’, ‘hilite’);
?>
<?php
function get_authors($postCount = true, $excludeAdmin = true, $showFullName = false, $detailLink = ”) {
global $tableusers, $tableposts, $wpdb, $author, $siteurl, $blogfilename;
echo “<div id=’authors’>”;
echo “- “;
- “;
if ($detailLink) {
echo ” ID\” title=\”user details for $name\”>$detailLink “;
}
if ($data->ID == $author) {
echo “” . $name . ““;
} else if ($posts == 0) {
echo $name;
} else {
echo “ID\” title=\”Posts by $data->user_nickname\”>$name ” . ($postCount ? ” ($posts)” : ”).”“;
}
echo “
$query = “SELECT ID, user_nickname, user_firstname, user_lastname from $tableusers ” . ($excludeAdmin ? “WHERE user_nickname <> ‘admin’ ” : ”) . “ORDER BY user_nickname”;
$res = $wpdb->get_results($query);
foreach($res as $data) {
$posts = get_usernumposts($data->ID);
$name = ($showFullName ? “$data->user_firstname $data->user_lastname” : $data->user_nickname);
echo ““;
}
echo ““;
echo “</div>”;
}
/////////////////////////////////////////////////////////////////////
function get_user_table($userid) {
if ($userid) {
$data = get_userdata($userid);
if ($data->ID) {
echo “<table id=\”user_table\”>”;
echo “<tr>”;
echo “</tr><tr>”;
echo “<th>Name</th><td>”. ($data->user_firstname . $data->user_lastname ? “$data->user_firstname $data->user_lastname” : ‘ ‘) . “</td>”;
echo “</tr><tr>”;
echo “<th>Nick</th><td>” . ($data->user_login ? $data->user_login : ‘ ‘) . “</td>”;
echo “</tr><tr>”;
echo “<th>Email</th><td>” . ($data->user_email ? “user_email\”>$data->user_email” : ‘ ’) . “</td>”;
echo “</tr><tr>”;
echo “<th>Description</th><td>” . ($data->user_description ? $data->user_description : ‘ ‘) . “</td>”;
echo “</tr><tr>”;
echo “<th>Posts</th><td>” . ($posts ? “ID\”>$posts” : ‘ ‘) . “</td>”;
echo “</tr><tr>”;
echo “</tr>”;
echo “</table>”;
return;
}
}
echo “Unknown user!”;
}
?>
Now enter
?><? php
?> - “;
The topic ‘where to fin myhack.php’ is closed to new replies.