any ideas yet on this?
I need some help to this also? It´s weird.
any ideas yet on this?
I need some help to this also? It´s weird.
OK, It works now.
I just copied everything inside next.php and pasted it to new file and named it next2.php.
I was having difficulty getting this one to work but I found this one works really well, just edit the output a bit to get the format you need.
Hi all,
I was unable to get the Random blog working with both versions of Next.php on my Admin Bar. So i took a look around the web and basically used php.net example with only a few changes.
Now I am "very" new to PHP and not a programmer of any languages by a long way - but once this is inserted (once for logged in and once for visitors) the it seems to work fine - which meets my simple needs.
I am no doubt sure that there is much more elegant code out there and I would be more than willing to use that if it works - anyhow thought I would share.
/* here we go with my own version of a random blog entry! */
// Formulate Query
// This is the best way to perform a SQL query
// For more examples, see mysql_real_escape_string()
$query = sprintf("SELECT domain FROM wp_blogs ORDER BY RAND( ) LIMIT 1",
mysql_real_escape_string($domain));
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
echo "\n\t
/* end of my randowm blog stuff*/
Thanks for this Dr Mike works great and very handy for me to get about all my blogs and randomly fix what needs fixed (with mu admin bar) I have a blog or 2 that i would like to not show when using the next.php. Would this be possible?
thanks and im sorry if this is answered elsewhere. I tink ive read everything in this forum the lst 24hrs
any update on this? I am still looking for a random blog plugin that works.
This is all that's in my next.php:
# Using existing login and password
include('wp-config.php');
# SQL Query
$sql="SELECT * FROM wp_blogs WHERE public = '1' AND mature = '0' AND spam = '0' AND deleted = '0' AND blog_id != '1' ORDER BY RAND() LIMIT 1";
#Get the results
$result = mysql_query($sql);
#Get the random domain selected
$variable = mysql_result($result,0, 'domain') . mysql_result($result,0, 'path');
#Refresh Blog
header("Location: http://$variable");
well how many different files are in the random blog plugin? Is there somewhere I can download this? Or is it just next.php?
got it thanks!
i am however, wondering if there is a way i can block certain blogs from showing up in the random blogs... anyone know a good way to do this? thanks!
Me too. I also don't want postless blogs to appear when someone clicks on next.
Why not add to the SQL to pick from a recently updated blog?
Anyone with any advice on how to block specific blogs from showing up??
thx .. work great
@bwinn
hi, can you provide me the link to the plugin or could u send it to admin @ goelji.com
Well I am not using a plugin... Here's how you do it.
Create a file, copy and paste the code below and name the file next.php
# Using existing login and password
include('wp-config.php');
# SQL Query
$sql="SELECT * FROM wp_blogs WHERE public = '1' AND mature = '0' AND spam = '0' AND deleted = '0' AND blog_id != '1' ORDER BY RAND() LIMIT 1";
#Get the results
$result = mysql_query($sql);
#Get the random domain selected
$variable = mysql_result($result,0, 'domain') . mysql_result($result,0, 'path');
#Refresh Blog
header("Location: http://$variable");
The place the next.php file in your root.
Then somewhere in your navigation, include the following:
<link to next.php>Random Blog<close link>
It's as simple as that, no need for a plugin here.
Actually a new website is here that does what you want, go visit it at http://www.randomblogblog.com and submit your blogs there
regards
Random Webmaster
@randomWebmaster - An old project of mine but still working but I don't think that's the topic theme here:
http://boonika.org/
« Previous 1 2