additional info page additional info page
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

additional info page

Started by sharky, October 28, 2007, 04:08:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sharky

hi all

is it possible / difficult to make a page called "infos.php" wich has following properties?

-background of the actual theme
-the text: "There are X new pics since your last login" (must work with bridged gallery too)
-the gallery infos "1 files in 15 albums and 5 categories with 0 comments viewed 2 times"


i would need a page like this in order to implement it on another page with an iframe. is tehre somebody who gently could make this? (ONLY if it is not too much work!)

thank you

igor

sharky

i already solved part 1 and 3. the part with the new pics is still missing. i have an idea on how to solve it, but dont know if it is possible and how to program it. my idea is this: (maybe somebody can do it)

add 2 tables to the users called "oldnumber" and "displaynumber"
on login make this:

displaynumber = numberofpics - oldnumber
oldnumber = numberofpics

echo: there are displaynumber new pics.

just as idea.. i dont know if this is possible. and i dont know if it works with bridged boards.

bye

igor

just_some_guy


<?php
$sql 
mysql_query("SELECT user_lastvisit FROM {$CONFIG['TABLE_USERS']} WHERE user_id = $uid");
$last_pics $sql;
$time now() - $last_pics;
$result mysql_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} WHERE mtime = $time");
$since_last =mysql_num_rows($result);

echo 
'There are '$since_last' new pics since your last login';

?>



Try this for the number of pictures since last visit. I may be wrong around the now() part. It quite easy to do, i used code from this part of the manual to get the number of pictures and I worked out the time diffrence and retriving the results.

Good Luck!

just_some_guy

Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

sharky

hi! thank you for your help! unfortunately the code hangs somewhere.

if i have:

somecode
echo A

the result is "A" written in the page.

if i have:

somecode
yourcode
echo A

the page is empty.

i dont knwo anything of php.. so i hope somebody can help me out. ill post then the whole finished code. maybe somebody else needs it.

thank you again

sharky

i googled a bit and discovered that the now() function is a sql function and not a php function. this means that i need to make a query to the database and assign the now() function result to a php variable.. but HOW? :D

bye

thanks

igor

Nibbler

The php equivalent is time(), however the code posted above is hopelessly wrong so don't waste much time on it.

sharky

thank you nibler!

yeah something is wrong.. it gives allways "0" as value.

nibler do you know a solution to this problem?

thanks

igor

Joachim Müller

Running "regular" mysql queries is not recommended anyway, you better use the equivalent functions used by Coppermine. What you're up to is called "content syndication", i.e. displaying content taken from coppermine on another page. There's a whole sub-board dedicated to this that contains mods that do what you're up to.

sharky

hi gaugau!

thank you for pointing me in the correct direction!

i checked the section but was not able to find anything similar to this.

ty

igor