MetOpen- Metropolitan Computer Solutions Open Software SiteMetOpen has been started by Metcomp to bring you open source news, advice and software. We also release PHPNuke modules.  
    Login or Register
HomeSoftwareArticlesForumsSearchAbout UsYour Account
    
 Menu
 Home :
. Articles
. About Us
. Projects
. MetPointsNew
. Testimonials
. Newsletters
 Web Links
 

. Downloads
. 

. Log in/Register
 Community :
. Forums
. Surveys
. Feedback
. Recommend Us

Submit News

. Bookmark this site
. Set as Home Page
 Projects
MetProjects 1.0 Track all your projects including modules, blocks and themes.Demo
MetOpen Super Topics 2.0 Consolidate your links, forum entries and articles about one topic on one page.Demo
MetOpen Home Page 2.01 Beautify Your Home PageDemo
MetMap 1.0 Give your visitors directions to your addressDemo
MetTestimonials 1.0 Easily manage your customer's positive wordsDemo
MetRecommend 1.0 Encourage your customer recommendationsDemo
MetFuture Articles 1.0 Show Your Visitors The Future of Your SiteDemo
MetAuthors 1.0 Taking Nuke Story Stats to a New LevelDemo
Our Projects
 Computer Solutions
MetComp Logo
MetComp offers:

Consulting
We can help you pick the right tools (including open source) so you can run your business at its optimum.

Software Development
We will create custom software to effectively run your business. We can customize PHPNuke or other CMSs or create modules to fit your needs.

Training
Whether you need computer training or PHPNuke training we will teach you how to get the most of your technology.

Great looking sites
We customize and create themes to highlight your site and make it easy to use.

Go to MetComp.com
www.metopen.com :: View topic - Move an Article to a different author Function may not work
  Forum FAQ    Search    Memberlist    Usergroups    Profile    Log in to check your private messages    Log in

 
Post new topicReply to topic
View previous topic Log in to check your private messages View next topic
Author Message
darkstar
Newbie
Newbie


Joined: Aug 20, 2004
Posts: 3

PostPosted: Aug Fri 20, 2004 10:19 am Reply with quoteBack to top

Hi, I am Ugur Kocak. I installed MetAuthors module to my website at http://www.turkforensic.org/modules.php?name=MetAuthors for experimental purposes. I seems to work nicely. But the (Move an Article to a different author) function does not change anything. I use phpnuke 7.1 with some security patches. What could be the reason? What sould I do? Thanks for your help...
Ugur Kocak
http://www.turkforensic.org
View user's profileSend private message
metopen
Newbie
Newbie


Joined: Jul 15, 2004
Posts: 199

PostPosted: Aug Fri 20, 2004 11:27 am Reply with quoteBack to top

Welcome Ugur,

Thanks for spotting the problem, it is corrected for the next version.
View user's profileSend private messageVisit poster's website
darkstar
Newbie
Newbie


Joined: Aug 20, 2004
Posts: 3

PostPosted: Aug Fri 20, 2004 2:55 pm Reply with quoteBack to top

Here is the index.php page:





<?php


if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}

require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);


Function MetAuthorsUpdateAuthors ($articleid,$author){
if ($articleid != "" and $author != ""){
global $db, $prefix;
$sql_query = "UPDATE ".$prefix."_stories SET informant = '$author', aid= '$author' WHERE sid = '$articleid' ";
//echo $sql;
$db->sql_query($sql_query);

Header("Location:modules.php?name=MetAuthors");

} else {
echo "You must enter an Article ID and an author username to move an article.";
}
}

Function MetAuthorsColumnists(){
$module_name = basename(dirname(__FILE__));
global $db, $prefix,$cookie;

include("header.php");
$uname = $cookie[1];
MetAuthorsMenu();
//Display author list
echo "<a name=\"authorlist\">";
OpenTable();
echo "<tr><td colspan=\"6\">Author List:</td></tr>";
echo "<tr><td></td><td>Author's Bio</td><td>Info</td></tr>";
$sql = "select ma.metauthorsid, ma.username as informant, ma.Salutation, ma.last, ma.first, ma.midinit, ma.suffix, ma.img, ma.bio, ma.columnist, ma.title, "
."count(*) as totcount, sum(st.counter) as totreads, round(avg(st.counter),0) as avgreads, round(avg( st.counter / ( TO_DAYS( NOW( ) ) - TO_DAYS( st.time ) ) ),1) AS readsperday, sum(st.ratings) as totvotes, round(sum(st.score)/sum(st.ratings),1) as avgrating "
."from ".$prefix."_metauthors ma, ".$prefix."_stories st where ma.username=st.informant group by ma.username order by ma.last, ma.first desc ";
//echo $sql;
$result = $db->sql_query($sql);

while ($row = $db->sql_fetchrow($result)) {
$authorname = $row[salutation]." ".$row[first]." ".$row[midinit]." ".$row[last];
echo ($uname==$row[informant] ? "<tr border=\"0\" bgcolor=\"#00FFFF\" >" : "<tr border=\"0\" bgcolor=\"#014361\">");
echo "<td><a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[informant]\">"
."<img src=\"".$row[img]."\" valign=\"top\" border =\"0\"><br />";
echo ($uname==$row[informant] ? "".$row[informant]."" : $row[informant]) ;
echo "</a></td>"
."<td>".$authorname."<br>"
.$row[bio]."</td>"
."<td>Articles: ".$row[totcount]."<br /> Reads: ".$row[totreads]."<br /> Avg Reads: ".$row[avgreads]."<br />Avg Rating: ".$row[avgrating]."/5.0<br />"
."<a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[informant]\">Read More From ".$authorname."</td>";
}
CloseTable();
echo "<br>";

echo "<form action=\"modules.php?name=".$module_name."\" method=\"post\">"
."Add a Columnist:<br />"
."Article Id: <input type=\"text\" name=\"articleid\" size=\"5\" value=\"\"> "
."Author: <input type=\"text\" name=\"author\" size=\"15\" value=\"\"> "
."<input type=\"hidden\" name=\"maction\" value=\"updateauthors\">"
."<input type=\"submit\" value=\"GO\">"
."</form>";
}

Function MetAuthorsMenu ($currentmenu=""){
$module_name = basename(dirname(__FILE__));
// echo "[ <a href=\"modules.php?name=".$module_name."&op=stats\">Stats</a> | <a href=\"modules.php?name=".$module_name."&op=columnists\">Columnists</a> ].";
}

Function MetAuthorsStats ( $articleid,$author,$maction){
global $db, $dbi, $prefix, $top,$cookie,$sitename;
$module_name = basename(dirname(__FILE__));
$uname = $cookie[1];
include("header.php");

if ($multilingual == 1) {
$querylang = "AND (alanguage='$currentlang' OR alanguage='')"; /* the OR is needed to display stories who are posted to ALL languages */

$queryalang = "WHERE (alanguage='$currentlang' OR alanguage='')"; /* top stories */
$querya1lang = "WHERE (alanguage='$currentlang' OR alanguage='') AND"; /* top stories */
$queryslang = "WHERE slanguage='$currentlang' "; /* top section articles */
$queryplang = "WHERE planguage='$currentlang' "; /* top polls */
$queryrlang = "WHERE rlanguage='$currentlang' "; /* top reviews */
} else {
$queryalang = "";
$querya1lang = "WHERE";
$queryslang = "";
$queryplang = "";
$queryrlang = "";
$querylang = "";
}

OpenTable();
echo "<center><font class=\"title\">"._TOPWELCOME." $sitename!</font></center>";
CloseTable();
echo "<br>\n\n";
MetAuthorsMenu();


echo "<p font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">";
if ($uname > "") echo _WELCOME." ".$uname.", <br><br>";
echo ""._SUBMITCONTENT."<br>";
echo "<img src=\"modules/$module_name/images/arrow_red.gif\"> ;;<a href=\"modules.php?name=Submit_News\">"._SUBMITARTICLE."</a><BR>";
echo "<img src=\"modules/$module_name/images/arrow_red.gif\"> ;;<a href=\"modules.php?name=Reviews&rop=write_review\">"._WRITEREVIEW."</a><BR>";
echo "<img src=\"modules/$module_name/images/arrow_red.gif\"> ;;<a href=\"modules.php?name=Web_Links&file=index&l_op=AddLink\">"._SUBMITWEBLINK."</a><BR>";
echo "<br>";
echo ""._STATISTICS."<br>";
echo "<img src=\"modules/$module_name/images/arrow_red.gif\"> ;;<a href=\"#qstat\">"._QUICKSTATOVERVIEW."</a><br>"
."<img src=\"modules/$module_name/images/arrow_red.gif\"> ;;<a href=\"#tstories30\">"._TOPRECENTSTORIES."</a><br>"
."<img src=\"modules/$module_name/images/arrow_red.gif\"> ;;<a href=\"#tstoriesall\">"._TOPALLSTORIES."</a><br>"
."<img src=\"modules/$module_name/images/arrow_red.gif\"> ;;<a href=\"#tauthors\">"._TOPAUTHORS."</a><br>"
."<img src=\"modules/$module_name/images/arrow_red.gif\"> ;;<a href=\"#monthlyarticlesoverview\">"._MONTHLYARTICLEOVERVIEW."</a><br>"
."<img src=\"modules/$module_name/images/arrow_red.gif\"> ;;<a href=\"#articlecountbytopic\">"._ARTICLECOUNTBYTOPIC."</a><br>"
."<img src=\"modules/$module_name/images/arrow_red.gif\"> ;;<a href=\"#articlecountbycategory\">"._ARTICLECOUNTBYCATEGORY."</a><br>"
."<hr>";
if (is_admin($admin)){
// if ($maction == "updateauthors") MetAuthorsUpdateAuthors($articleid,$author);
echo "<form action=\"modules.php\" method=\"post\">"
."Move an Article to a different author:<br />"
."Article Id: <input type=\"text\" name=\"articleid\" size=\"5\" value=\"\"> "
."Author: <input type=\"text\" name=\"author\" size=\"15\" value=\"\"> "
."<input type=\"hidden\" name=\"op\" value=\"guncelle\">" //burası
."<input type=\"hidden\" name=\"name\" value=\"MetAuthors\">" //burası
."<input type=\"submit\" value=\"GO\">"
."</form>";
echo "<hr>";
}
/* Quick Stat Overview */
echo "<a name=\"qstat\">";
echo ""._QUICKSTATOVERVIEW." <br /><br />";
$sql = "SELECT sum( counter ) "
."FROM `nuke_stories` ";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
//echo $sql."<br />";
$numreadso = $row[0];

//recent stories
$sql = "SELECT count(sid), sum( counter ) "
."FROM `nuke_stories` where (TO_DAYS(NOW()) - TO_DAYS(time) <= 30) ";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
//echo $sql."<br />";
$numstoriesr = $row[0];
$numreadsr = $row[1];

$sql = "SELECT counter FROM `nuke_stories` ORDER BY counter DESC LIMIT 9 , 1";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
//echo $sql."<br />";
$readstotop =$row[0];

$sql = "SELECT sum( counter ) "
."FROM `nuke_stories` where counter >= $row[0] order by counter desc ";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
//echo $sql."<br />";
$numreadst = $row[0];

$sql = "SELECT count( sid ) "
."FROM `nuke_stories` ";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$numstorieso = $row[0];
//echo $sql."<br />";

echo "<table border=\"1\" cellpadding=\"1\"><tr><td></td><td>"._STORYREADS."</td><td>"._STORIES."</td><td>"._STORYAVGREADS."</td></tr>"
."<tr><td>"._OVERALL."</td> <td>".$numreadso."</td><td>".$numstorieso."</td><td>".round(($numreadso / $numstorieso),0)."</td><td></tr>"
."<tr><td>"._RECENT."</td> <td>".$numreadsr."</td><td>".$numstoriesr."</td><td>".round(($numreadsr / $numstoriesr),0)."</td><td></tr>"
."<tr><td>Top $top</td> <td>".$numreadst."</td><td>".$top."</td><td>".round(($numreadst / $top),0)."</td><td></tr>";
echo "</table>";
echo "Reads to make top 10: ".$readstotop.". ";

echo " <br /> <br /> ";



//Display the top stories in the last 30 days
echo "<a name=\"tstories30\">";
OpenTable();
echo "<tr><td colspan=\"6\">"._TOPRECENTSTORIES."</td></tr>";
echo "<tr><td>#</td><td>"._STORYTITLE."</td><td>"._STORYDATE."</td><td>"._AUTHORNAME."</td><td>"._STORYREADS."</td><td>"._READSPERDAY."</td></tr>";
$sql = "select sid, title, counter, informant, left(time,10) as sttime, counter/(TO_DAYS(NOW()) - TO_DAYS(time)) as readsperday from ".$prefix."_stories where (TO_DAYS(NOW()) - TO_DAYS(time) <= 30) $querylang order by counter desc ";
$result = $db->sql_query($sql);
$whilectr=1;
while ($row = $db->sql_fetchrow($result)) {
echo ($uname==$row[informant] ? "<tr bgcolor=\"#00FFFF\" >" : "<tr bgcolor=\"#014361\">");
echo "<td>$whilectr</td>"
."<td><a href=\"modules.php?name=News&file=article&sid=".$row[sid]."\">".$row[title]."</a></td> "
."<td>".$row[sttime]."</td><td><a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[informant]\">";
echo ($uname==$row[informant] ? "".$row[informant]."" : $row[informant]) ;
echo "</a></td>"
."<td>".$row[counter]."</td><td>".$row[readsperday]."</td></tr>";
$whilectr++;
}
CloseTable();
echo "<br>";

//Display the top stories all time
echo "<a name=\"tstoriesall\">";
OpenTable();
echo "<tr><td colspan=\"6\">$top "._READSTORIES."</td></tr>";
echo "<tr><td>#</td><td>"._STORYTITLE."</td><td>"._STORYDATE."</td><td>"._AUTHORNAME."</td><td>"._STORYREADS."</td><td>"._READSPERDAY."</td></tr>";
$sql = "select sid, title, counter, informant, left(time,10) as sttime, counter/(TO_DAYS(NOW()) - TO_DAYS(time)) as readsperday from ".$prefix."_stories where 1=1 $querylang order by counter desc limit 0,$top";
$result = $db->sql_query($sql);
$whilectr=1;
while ($row = $db->sql_fetchrow($result)) {
echo ($uname==$row[informant] ? "<tr bgcolor=\"#00FFFF\" >" : "<tr bgcolor=\"#014361\">");
echo "<td>$whilectr</td>"
."<td><a href=\"modules.php?name=News&file=article&sid=".$row[sid]."\">".$row[title]."</a></td> "
."<td>".$row[sttime]."</td><td><a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[informant]\">";
echo ($uname==$row[informant] ? "".$row[informant]."" : $row[informant]) ;
echo "</a></td>"
."<td>".$row[counter]."</td><td>".$row[readsperday]."</td></tr>";

$whilectr++;
}
CloseTable();
echo "<br>";

/* Top 10 authors */
echo "<a name=\"tauthors\">";
$sql ="select informant, count(*) as totcount, sum(counter) as totreads, round(avg(counter),0) as avgreads, round(avg( counter / ( TO_DAYS( NOW( ) ) - TO_DAYS( time ) ) ),1) AS readsperday, sum(ratings) as totvotes, round(sum(score)/sum(ratings),1) as avgrating from ".$prefix."_stories group by informant order by totreads DESC limit 0,$top";
//echo $sql;
$result = $db->sql_query($sql);

if (sql_num_rows($result, $dbi)>0) {
OpenTable();
echo "<tr><td colspan=\"6\">"._TOP." $top "._AUTHORS."</td></tr>";
echo "<tr><td>#</td><td>"._AUTHORNAME."</td><td>"._NUMSTORIES."</td><td>"._STORYREADS."</td><td>"._STORYAVGREADS."</td><td>"._READSPERDAY."</td><td>"._TOTALRATINGS."</td><td>"._AVGRATINGS."</td></tr>";
$whilectr=1;
while ($row = $db->sql_fetchrow($result)) {
echo ($uname==$row[informant] ? "<tr bgcolor=\"#00FFFF\" >" : "<tr bgcolor=\"#014361\">");
echo "<td>$whilectr</td>"
."<td><a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[informant]\">";
echo ($uname==$row[informant] ? "".$row[informant]."" : $row[informant]) ;
echo "</a></td>"
."<td>".$row[totcount]."</td>"
."<td>".$row[totreads]."</td>"
."<td>".$row[avgreads]."</td>"
."<td>".$row[readsperday]."</td>"
."<td>".$row[totvotes]."</td>"
."<td>".$row[avgrating]."</td>"
."</tr>";

$whilectr++;
}
CloseTable();
echo "<br>";
} else "No user authors";


OpenTable();
echo "<a name=\"monthlyarticlesoverview\">"
.""._MONTHLYARTICLEOVERVIEW." <br /><br />";

$sql = "SELECT left(time,7) as mong, count(*) as mcount FROM `".$prefix."_stories` WHERE 1 group by mong "
."order by mong desc ";
$result = $db->sql_query($sql);
echo "<table><tr><td>"._MONTH."</td><td>"._STORYREADS."</td></tr>";
while ($row = $db->sql_fetchrow($result)) {
echo "</tr><td>".$row[mong]."</td><td>".$row[mcount]."</td></tr>";

}
echo "</table><br /><br /><br />";

echo "<a name=\"articlecountbytopic\">"
.""._ARTICLECOUNTBYTOPIC."<br /><br />";

$sql = "SELECT t.topictext AS topicname, count( * ) AS mcount, sum( s.counter ) AS reads, round( sum( s.counter ) / count( * ) , 0 ) AS avgreads "
."FROM `nuke_stories` s, nuke_topics t "
."WHERE t.topicid = s.topic "
."GROUP BY t.topicname "
."order by t.topicname asc ";
//echo $sql;
$result = $db->sql_query($sql);
echo "<table><tr><td>"._TOPIC."</td><td>"._NUMSTORIES."</td><td>"._STORYREADS."</td><td>"._STORYAVGREADS."</td></tr>";
while ($row = $db->sql_fetchrow($result)) {
echo "</tr><td>".$row[topicname]."</td><td>".$row[mcount]."</td><td>".$row[reads]."</td><td>".$row[avgreads]."</td></tr>";

}
echo "</table><br /><br /><br />";

echo "<a name=\"articlecountbycategory\">"
.""._ARTICLECOUNTBYCATEGORY."<br /><br />";


$sql = "SELECT IF ( c.Title IS NULL , \"Articles\", c.Title) AS category, count( * ) AS mcount, sum( s.counter ) AS reads, round( sum( s.counter ) / count( * ) , 0 ) AS avgreads "
."FROM `nuke_stories` s "
."LEFT JOIN nuke_stories_cat c ON s.catid = c.catid "
."WHERE 1 "
."GROUP BY category "
."ORDER BY category ASC ";
//echo $sql;
$result = $db->sql_query($sql);
echo "<table><tr><td>"._TOPIC."</td><td>"._NUMSTORIES."</td><td>"._STORYREADS."</td><td>"._STORYAVGREADS."</td></tr>";
while ($row = $db->sql_fetchrow($result)) {
echo "</tr><td>".$row[category]."</td><td>".$row[mcount]."</td><td>".$row[reads]."</td><td>".$row[avgreads]."</td></tr>";

}
echo "</table><br /><br /><br />";


CloseTable();

echo "<br />";



//echo "<center><font color=\"$textcolor2\">Extended functions by <a href=http://www.phpnuke-service.de>PHPNuke-Service.de</a> and <a href=http://www.complex-berlin.de>Complex-Berlin.de</a></font></center>\n";
echo "<center><font color=\"$textcolor2\">Provided by <a href=\"http://www.metopen.com\">MetOpen.com</a></font></center>\n";

include("footer.php");
}

switch($op) {
case "columnists":
MetAuthorsColumnists();
break;
case "guncelle":
MetAuthorsUpdateAuthors ($articleid,$author);
break;
case "stats":
default:
MetAuthorsStats($articleid,$author,$maction);

}

?>
View user's profileSend private message
metopen
Newbie
Newbie


Joined: Jul 15, 2004
Posts: 199

PostPosted: Aug Fri 20, 2004 5:52 pm Reply with quoteBack to top

Are you interested in trying a preview of 2.0 which has it corrected? If so give me an email address and i'll send it to you.
View user's profileSend private messageVisit poster's website
darkstar
Newbie
Newbie


Joined: Aug 20, 2004
Posts: 3

PostPosted: Aug Sat 21, 2004 3:22 am Reply with quoteBack to top

Thanks for your efforts. My e-mail is forensource@yahoo.com I give yahoo address because it has 100 MB capacity Smile
View user's profileSend private message
metopen
Newbie
Newbie


Joined: Jul 15, 2004
Posts: 199

PostPosted: Aug Sun 22, 2004 10:19 am Reply with quoteBack to top

I've sent it to you. Let me know if you have any trouble.
View user's profileSend private messageVisit poster's website
Guardian
Newbie
Newbie


Joined: Jun 25, 2005
Posts: 18

PostPosted: May Mon 15, 2006 1:35 am Reply with quoteBack to top

Given that the last post was in 2004 and we are now in 2006, does the current version of MetAutors have the sql file for those tables and the functions now working?
View user's profileSend private message
Display posts from previous:      
Post new topicReply to topic
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001 phpBB Group

PHP-Nuke Port by Tom Nitzschner © 2004 www.toms-home.com

[Template Redesign By: Lorkan Themes]
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © 2004 by Metcomp.
You can syndicate our news using the file backend.php or ultramode.txt Valid HTML 4.01 Transitional
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.52 Seconds

FiSubSilver Shadow Theme by Daz - Modified by: Lorkan Themes ©2004