I have come to a cross roads with my buisness website now, where I have everything I need from the RN CMS however the one lacking area is the Content section. Now I don't mind framing inside other php scripts I just wanted to know if any of you have seen anything like the below sites before:
Only registered users can see links on this board! Get registered or login to the forums!
Only registered users can see links on this board! Get registered or login to the forums!
A way for me to have small boxes in a listing setting with options for expandable pages etc. With the possibility of sub categories etc. Really gives me a way to put content out for clients of my website.
If you have any thoughts or have seen any PHP/Related scripts that I could use please feel free to post here!
P.S. Unfortunately I don't think the 2.2.2 of the Content Plus will be out anytime soon so I dont think the 2.2.1 will suffice for my needs
Joined: Dec 01, 2005 Posts: 530 Location: Santiago, Dominican Republic
Posted:
Tue Jun 15, 2010 5:36 pm
Version 2.2.2 of Content Plus is the one distributed within RavenNuke 2.4.x itself. Subcategories is the wishlist for an upcoming major version of CP... And don't get the idea on the small boxes thing, please briefly explain it as I might be a lil retarded today
Take a look at what I did today. Kemana is a good directory script. Too bad it couldnt be ported over to nuke
Only registered users can see links on this board! Get registered or login to the forums!
Edit: Why does it say on the Slaytanic sitethat Content 2.2.1 is the only one released and that 2.2.2 would provide sub-categories? I thought it must have been a typo when I read it in the RN copyright.
Well actually I got Kemana to work out perfectly I think I will post the results when I finish up with it.
Anyways I was wondering how this would work. The Kemana is a seperate portalish site kind of like a standalone coppermine if you were to think of it like that. Now there are only a limited number of php files it accesses so I need to add some lines of code so that I can wrap my theme around it?
Im guessing something like ../
includes("../mainfile.php) or something needs to be added?
I made a folder called Directory put it into the modules folder and then activated from the RN 2.40.1 ACP.
Then i modified my index.php for the Kemana directory (which is its own portal pulling from its own database)
I then pointed to the module:
Only registered users can see links on this board! Get registered or login to the forums!
It doesnt show anything for the module as well as no footer!
Here is the index.php with the added 'include' as you requested which I just pulled from another module. Tell me what you think!
Code:
<?php
if ( !defined('MODULE_FILE') ) {
die ('You can\'t access this file directly...');
}
if (!defined('INDEX_FILE')) define('INDEX_FILE', true); // Set to FALSE to hide right blocks
require_once('mainfile.php');
include("header.php");
function check_backlink ()
{
global $db_prefix;
// get which dir_set requires backlink
$f = sql_qquery ("SELECT dir_id FROM ".$db_prefix."dir_set WHERE set_backlink='1' ORDER BY RAND() LIMIT 1");
$ds = $f[0];
// get a url
$row = sql_qquery ("SELECT item_id, backlink FROM ".$db_prefix."link WHERE dir_id='$ds' AND backlink_status = '0' LIMIT 1");
if (!empty ($row))
{
// is it available?
if (!empty ($row['backlink']))
{
$tmp = remote_fopen ($row['backlink']);
if (empty ($tmp))
{
sql_query ("UPDATE ".$db_prefix."link SET backlink_status = '-1' WHERE item_id=$row[item_id] LIMIT 1");
}
else
{
if (!strpos ($tmp, html_unentities ($config['backlink_txt'])))
sql_query ("UPDATE ".$db_prefix."link SET backlink_status = '-1' WHERE item_id=$row[item_id] LIMIT 1");
else
sql_query ("UPDATE ".$db_prefix."link SET backlink_status = '1' WHERE item_id=$row[item_id] LIMIT 1");
}
}
else
sql_query ("UPDATE ".$db_prefix."link SET backlink_status = '-1' WHERE item_id=$row[item_id] LIMIT 1");
}
else
{
// if no more backlink to check, reset everything back to 'unchecked'
sql_query ("UPDATE ".$db_prefix."link SET backlink_status='0' WHERE dir_id='$ds'");
}
}
function check_url ()
{
global $db_prefix;
// get which dir_set requires backlink
$f = sql_qquery ("SELECT dir_id FROM ".$db_prefix."dir_set WHERE set_url='1' ORDER BY RAND() LIMIT 1");
$ds = $f[0];
// get a url
$row = sql_qquery ("SELECT item_id, url FROM ".$db_prefix."link WHERE dir_id='$ds' AND url_status = '0' LIMIT 1");
if (!empty ($row))
{
// is it available?
if (!empty ($row['url']))
{
$tmp = @remote_fopen ($row['url']);
if (empty ($tmp))
sql_query ("UPDATE ".$db_prefix."link SET url_status = '-1' WHERE item_id=$row[item_id] LIMIT 1");
else
sql_query ("UPDATE ".$db_prefix."link SET url_status = '1' WHERE item_id=$row[item_id] LIMIT 1");
}
}
else
{
// if no more backlink to check, reset everything back to 'unchecked'
sql_query ("UPDATE ".$db_prefix."link SET url_status='0' WHERE dir_id='$ds'");
}
}
/************************************************
* Powered with qEngine v3 (c) C97.net
* All rights reserved
************************************************/
// check install/
if (file_exists ('./install/'))
{
die ('If you have just installed Kemana, please delete the <b>"install/"</b> folder on your server before using Kemana v1.4 (build 2010.04.20). Or <a href="install/index.php">'
.'click here</a> to install Kemana for the first time.');
}
// very important file
require "./includes/user_init.php";
// close site?
if ($config['close_site']) msg_die ('site_closed');
// referral mode?
$ref = get_param ('ref');
if (!empty ($ref))
{
$ip = $_SERVER['REMOTE_ADDR'];
$row = sql_fetch_array (sql_query ("SELECT * FROM ".$db_prefix."ip_referred WHERE ref_ip = '$ip' LIMIT 1"));
if (empty ($row['ref_ip']))
{
sql_query ("INSERT INTO ".$db_prefix."ip_referred VALUES ('$ip', 'refer', UNIX_TIMESTAMP())");
sql_query ("UPDATE ".$db_prefix."user SET user_reff=user_reff+1 WHERE user_id='$ref' LIMIT 1");
}
redir ($config['site_url']);
}
// verify backlink? only 1 out of 10 visitors && backlink_code defined && allow http fopen
if ($config['backlink_txt'] && (mt_rand (1, 10) == 5)) check_backlink ();
if ($config['check_url'] && (mt_rand (1, 10) == 5)) check_url ();
// autoexec the following lines once each day
if ($config['last_autoexec'] != $sql_today)
{
// send emails to soon to be expired
$etpl = load_tpl ('mail', 'mail_expire.tpl');
// only sent to: premium or sponsored, which will be expired in 7 days, has not been sent the email, and not edited (waiting for approval) links
$last7 = convert_date ($sql_today, 'sql', 7);
$res = sql_query ("SELECT item_id, title, short_note, t1.user_id, email, list_premium, list_sponsored, end_sponsored
FROM ".$db_prefix."link AS t1 JOIN ".$db_prefix."user AS t2 USING (user_id)
WHERE (list_premium = '1' OR list_sponsored='1') AND end_sponsored <= '$last7' AND exp_mailed != '1' AND old_id='0'");
while ($row = sql_fetch_array ($res))
{
$row['site_url'] = $config['site_url'];
$row['site_name'] = $config['site_name'];
$row['end_sponsored'] = convert_date ($row['end_sponsored'], 'long');
$body = quick_tpl ($etpl, $row);
email ($email, $lang['l_exp_subject'], $body, 1, 1); // send the email (logged)
sql_query ("UPDATE ".$db_prefix."link SET exp_mailed='1' WHERE item_id='$row[item_id]' LIMIT 1"); // mark as sent
}
// update expired sponsore/preimum
sql_query ("UPDATE ".$db_prefix."link SET list_regular='1', list_premium='0', list_sponsored='0' WHERE end_sponsored < '$sql_today'");
// 2.1 fix featured links for single dir_set
if (!$multiple_set && empty ($config['featured_item']))
{
$f = sql_qquery ("SELECT featured FROM ".$db_prefix."dir_set LIMIT 1");
$config['featured_item'] = $f[0];
}
if ($config['featured_item'])
{
$f = explode (';', $config['featured_item']);
foreach ($f as $val)
{
$i++;
// 3. get new link
$txt['block_new'] = ''; $i = 0; $r = $config['new_col'];
$foo = array ('subblock_new' => '');
$res = sql_query ("SELECT item_id FROM ".$db_prefix."link WHERE status='O' ORDER BY item_id DESC LIMIT $config[new_link]");
while ($row = sql_fetch_array ($res))
{
$i++;
// 4. get popular links
$txt['block_popular'] = ''; $i = 0; $r = $config['pop_col'];
$foo = array ('subblock_popular' => '');
$res = sql_query ("SELECT item_id FROM ".$db_prefix."link WHERE status='O' ORDER BY stat_hits DESC LIMIT $config[pop_link]");
while ($row = sql_fetch_array ($res))
{
$i++;
// 5. create featured content
$txt['block_feat_content'] = '';
$res = sql_query ("SELECT * FROM ".$db_prefix."featured ORDER BY idx");
while ($row = sql_fetch_array ($res))
{
if (!empty ($row['feat_img']))
$row['content'] = "<a href=\"$row[feat_url]\"><img src=\"public/image/$row[feat_img]\" alt=\"$row[feat_title]\" /></a>";
else
$row['content'] = $row['feat_text'];
$txt['block_feat_content'] .= quick_tpl ($tpl_block['feat_content'], $row);
}
// 6. get old tree method (cached, and only for SINGLE DIR)
if (!$multiple_set)
{
$s = sql_qquery ("SELECT dir_id FROM ".$db_prefix."dir_set LIMIT 1");
$set = $s[0]; $num_sub = $config['cat_all_sub'] + 1;
All ive done is add the include mainfile/header/footer lines at the top and bottom.
All the rest of the code works fine as for the actual portal I am trying to insert into my theme.
I even tried this; copying the Kemana Directory root to a folder called, 'Directory' within the nuke root. then changed the code to this (notice the '../') Cause it doesnt have to be a module I just need the theme wrapped around this portal. But I am still getting a white screen of death...
Code:
<?php
require_once('../mainfile.php');
include("../header.php");
function check_backlink ()
{
global $db_prefix;
// get which dir_set requires backlink
$f = sql_qquery ("SELECT dir_id FROM ".$db_prefix."dir_set WHERE set_backlink='1' ORDER BY RAND() LIMIT 1");
$ds = $f[0];
// get a url
$row = sql_qquery ("SELECT item_id, backlink FROM ".$db_prefix."link WHERE dir_id='$ds' AND backlink_status = '0' LIMIT 1");
if (!empty ($row))
{
// is it available?
if (!empty ($row['backlink']))
{
$tmp = remote_fopen ($row['backlink']);
if (empty ($tmp))
{
sql_query ("UPDATE ".$db_prefix."link SET backlink_status = '-1' WHERE item_id=$row[item_id] LIMIT 1");
}
else
{
if (!strpos ($tmp, html_unentities ($config['backlink_txt'])))
sql_query ("UPDATE ".$db_prefix."link SET backlink_status = '-1' WHERE item_id=$row[item_id] LIMIT 1");
else
sql_query ("UPDATE ".$db_prefix."link SET backlink_status = '1' WHERE item_id=$row[item_id] LIMIT 1");
}
}
else
sql_query ("UPDATE ".$db_prefix."link SET backlink_status = '-1' WHERE item_id=$row[item_id] LIMIT 1");
}
else
{
// if no more backlink to check, reset everything back to 'unchecked'
sql_query ("UPDATE ".$db_prefix."link SET backlink_status='0' WHERE dir_id='$ds'");
}
}
function check_url ()
{
global $db_prefix;
// get which dir_set requires backlink
$f = sql_qquery ("SELECT dir_id FROM ".$db_prefix."dir_set WHERE set_url='1' ORDER BY RAND() LIMIT 1");
$ds = $f[0];
// get a url
$row = sql_qquery ("SELECT item_id, url FROM ".$db_prefix."link WHERE dir_id='$ds' AND url_status = '0' LIMIT 1");
if (!empty ($row))
{
// is it available?
if (!empty ($row['url']))
{
$tmp = @remote_fopen ($row['url']);
if (empty ($tmp))
sql_query ("UPDATE ".$db_prefix."link SET url_status = '-1' WHERE item_id=$row[item_id] LIMIT 1");
else
sql_query ("UPDATE ".$db_prefix."link SET url_status = '1' WHERE item_id=$row[item_id] LIMIT 1");
}
}
else
{
// if no more backlink to check, reset everything back to 'unchecked'
sql_query ("UPDATE ".$db_prefix."link SET url_status='0' WHERE dir_id='$ds'");
}
}
/************************************************
* Powered with qEngine v3 (c) C97.net
* All rights reserved
************************************************/
// check install/
if (file_exists ('./install/'))
{
die ('If you have just installed Kemana, please delete the <b>"install/"</b> folder on your server before using Kemana v1.4 (build 2010.04.20). Or <a href="install/index.php">'
.'click here</a> to install Kemana for the first time.');
}
// very important file
require "./includes/user_init.php";
// close site?
if ($config['close_site']) msg_die ('site_closed');
// referral mode?
$ref = get_param ('ref');
if (!empty ($ref))
{
$ip = $_SERVER['REMOTE_ADDR'];
$row = sql_fetch_array (sql_query ("SELECT * FROM ".$db_prefix."ip_referred WHERE ref_ip = '$ip' LIMIT 1"));
if (empty ($row['ref_ip']))
{
sql_query ("INSERT INTO ".$db_prefix."ip_referred VALUES ('$ip', 'refer', UNIX_TIMESTAMP())");
sql_query ("UPDATE ".$db_prefix."user SET user_reff=user_reff+1 WHERE user_id='$ref' LIMIT 1");
}
redir ($config['site_url']);
}
// verify backlink? only 1 out of 10 visitors && backlink_code defined && allow http fopen
if ($config['backlink_txt'] && (mt_rand (1, 10) == 5)) check_backlink ();
if ($config['check_url'] && (mt_rand (1, 10) == 5)) check_url ();
// autoexec the following lines once each day
if ($config['last_autoexec'] != $sql_today)
{
// send emails to soon to be expired
$etpl = load_tpl ('mail', 'mail_expire.tpl');
// only sent to: premium or sponsored, which will be expired in 7 days, has not been sent the email, and not edited (waiting for approval) links
$last7 = convert_date ($sql_today, 'sql', 7);
$res = sql_query ("SELECT item_id, title, short_note, t1.user_id, email, list_premium, list_sponsored, end_sponsored
FROM ".$db_prefix."link AS t1 JOIN ".$db_prefix."user AS t2 USING (user_id)
WHERE (list_premium = '1' OR list_sponsored='1') AND end_sponsored <= '$last7' AND exp_mailed != '1' AND old_id='0'");
while ($row = sql_fetch_array ($res))
{
$row['site_url'] = $config['site_url'];
$row['site_name'] = $config['site_name'];
$row['end_sponsored'] = convert_date ($row['end_sponsored'], 'long');
$body = quick_tpl ($etpl, $row);
email ($email, $lang['l_exp_subject'], $body, 1, 1); // send the email (logged)
sql_query ("UPDATE ".$db_prefix."link SET exp_mailed='1' WHERE item_id='$row[item_id]' LIMIT 1"); // mark as sent
}
// update expired sponsore/preimum
sql_query ("UPDATE ".$db_prefix."link SET list_regular='1', list_premium='0', list_sponsored='0' WHERE end_sponsored < '$sql_today'");
// 2.1 fix featured links for single dir_set
if (!$multiple_set && empty ($config['featured_item']))
{
$f = sql_qquery ("SELECT featured FROM ".$db_prefix."dir_set LIMIT 1");
$config['featured_item'] = $f[0];
}
if ($config['featured_item'])
{
$f = explode (';', $config['featured_item']);
foreach ($f as $val)
{
$i++;
// 3. get new link
$txt['block_new'] = ''; $i = 0; $r = $config['new_col'];
$foo = array ('subblock_new' => '');
$res = sql_query ("SELECT item_id FROM ".$db_prefix."link WHERE status='O' ORDER BY item_id DESC LIMIT $config[new_link]");
while ($row = sql_fetch_array ($res))
{
$i++;
// 4. get popular links
$txt['block_popular'] = ''; $i = 0; $r = $config['pop_col'];
$foo = array ('subblock_popular' => '');
$res = sql_query ("SELECT item_id FROM ".$db_prefix."link WHERE status='O' ORDER BY stat_hits DESC LIMIT $config[pop_link]");
while ($row = sql_fetch_array ($res))
{
$i++;
// 5. create featured content
$txt['block_feat_content'] = '';
$res = sql_query ("SELECT * FROM ".$db_prefix."featured ORDER BY idx");
while ($row = sql_fetch_array ($res))
{
if (!empty ($row['feat_img']))
$row['content'] = "<a href=\"$row[feat_url]\"><img src=\"public/image/$row[feat_img]\" alt=\"$row[feat_title]\" /></a>";
else
$row['content'] = $row['feat_text'];
$txt['block_feat_content'] .= quick_tpl ($tpl_block['feat_content'], $row);
}
// 6. get old tree method (cached, and only for SINGLE DIR)
if (!$multiple_set)
{
$s = sql_qquery ("SELECT dir_id FROM ".$db_prefix."dir_set LIMIT 1");
$set = $s[0]; $num_sub = $config['cat_all_sub'] + 1;
Joined: Feb 21, 2006 Posts: 1497 Location: In front of a screen....HELP! lol
Posted:
Fri Jun 18, 2010 12:19 am
hi transit,
once you include the mainfile.php, your RN install creates a mysql connection. Anything using mysql_query, will then use that connection instead.
Things like: require "./includes/user_init.php";
will not work outright, as they will technically be within your modules directory, and not within the includes directory of the root of your site.
This app should be ported over to Ravennuke.
For a temporary fix, you could create a module that simply loads a frame(or iframe), which opens up your content within the ravennuke header, blocks and footer:
Code:
<?php
if ( !defined('MODULE_FILE') ) {
die ('You can\'t access this file directly...');
}
require_once('mainfile.php');
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$pagetitle = '- '.$module_name;
// BEGIN: Added in v2.40.00 - Mantis Issue 0001043
$index = 0;
if (!defined('INDEX_FILE')) define('INDEX_FILE', true); // Set to FALSE to hide right blocks
if (defined('INDEX_FILE') AND INDEX_FILE===true) {
// auto set right blocks for pre patch 3.1 compatibility
$index = 1;
}
include('header.php');
echo "html code for your frame";
include('footer.php');
?>
This is not the ideal solution right now, but I can't write a port in a matter of minutes, but I could attempt to port over your info into a module at a later date. Until then, this may help.
Ive been thinking and maybe I guess the easiest thing is since its not just simple html code but a whole wack of interlinking files. I should edit the outline.tpl which is the theme for this directory and wrap the theme I am using for this site around it as I wont be changing it. Then simply edit the links on the header to link back to the nuke installation. Thoughts?
View next topic View previous 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