Jamen dog! Hvor er det JavaScript henne?
Din browser understøtter ikke JavaScript eller har ikke understøttelsen slået til. Slå JavaScript til i din browser for at se denne side ordentligt, eller opgrader til en browser, der understøtter JavaScript.
Besøgende online nu
Gæster online 15
Brugere online 0

Antal brugere: 185
Nyeste bruger: Mrnight

Tilføjelse til datafil

Sidst opdateret den 10 år siden
A
afosterBruger
Skrevet d. 10 år siden
Jeg forsøger at tilføje følgende kode til den autonews_data bruge billeder koden til at lade brugerne vide, at en ny video er blevet opdateret. Video vises på admin siden, men når jeg kontrollere den aktuelle e-mail, er der en fejlmeddelelse, der siger DB_VIDEO ikke findes i databasen. Kan du vise mig, hvor min fejl ligger?

/ / Videoer
   14 => array (
     'id' => 4,
     Â»type« => $ locale ['AN641'],
     'text' => $ locale ['AN642'],
     'type1' => $ locale ['AN643'],
     'type2' => $ locale ['AN644'],
     'parse1' => 'tilbagevenden pagelink (\' PA \ ', $ data [\' item_id \ '], trimlink ($ data [\' item_text \ '], $ autonews_settings [\' maxlen \ '])),' ,
     'parse2' => 'tilbagevenden pagelink (\' P \ ', $ data [\' item2_id \ '], trimlink ($ data [\' item2_text \ '], $ autonews_settings [\' maxlen \ '])),' ,
     'query' => "SELECT MIN (tid) AS tidsstempel,
                         user_id,
                         user_name,
                         ta.cat_id AS item_id,
                         tælle (*) AS item_no,
                         cat_name AS item_text,
                         MIN (id) som item2_id,
                         0 AS item2_no,
                         '. "$ locale [' AN645 ']".' AS item2_text
                         FRA ". DB_VIDEO". AS tp
                         LEFT JOIN ". DB_VIDEO_CAT". AS ta ON (ta.cat_id = tp.cat_id)
                         LEFT JOIN ". DB_USERS". AS tu ON (uid = user_id)
                         HVOR
«. useraccess (cat_access"). "OG
tid> ". $ ts_cut."
                         GROUP BY ta.cat_id, uid
                         SOM item_no> 0; "
   ),


Nogle yderligere oplysninger:

Videoen infusion har tre borde, video, video_cat og video_settings
A
afosterBruger
Skrevet d. 10 år siden
Ingen opkald hjælpe mig med dette?
F
fljFusioneer
Skrevet d. 10 år siden
Please post the code without running it through google translate - it is close to unreadable in its present state.
A
afosterBruger
Skrevet d. 10 år siden
Thank you for letting me know the problem about the google translation.

I am trying add the notification of new videos to the autonews infusion using the suggested way you have stated in the text file that is included in the download. Here is the code I am using but it keeps giving me an error msg that there is no DB_VIDEO database. That is correct, there is no database by that name. Any assistance you can provide would be much appreciated.

// Videos
  14 => array(
    'id'    => 4,
    'type'  => $locale['AN641'],
    'text'  => $locale['AN642'],
    'type1' => $locale['AN643'],
    'type2' => $locale['AN644'],
    'parse1'=> 'return pagelink(\'PA\', $data[\'item_id\'], trimlink($data[\'item_text\'], $autonews_settings[\'maxlen\']));',
    'parse2'=> 'return pagelink(\'P\', $data[\'item2_id\'], trimlink($data[\'item2_text\'], $autonews_settings[\'maxlen\']));',
    'query' => "SELECT  MIN(time) AS timestamp,
                        user_id,
                        user_name,
                        ta.cat_id AS item_id,
                        count(*) AS item_no,
                        cat_name AS item_text,
                        MIN(id) as item2_id,
                        0 AS item2_no,
                        '".$locale['AN645']."' AS item2_text
                        FROM ".DB_VIDEO." AS tp
                        LEFT JOIN ".DB_VIDEO_CAT." AS ta ON (ta.cat_id = tp.cat_id)
                        LEFT JOIN ".DB_USERS." AS tu ON (uid = user_id)   
                        WHERE
                                       ".useraccess('cat_access')." AND
                                       time > ".$ts_cut."
                        GROUP BY ta.cat_id, uid
                        HAVING item_no > 0;"                                               
  ),
A
afosterBruger
Skrevet d. 10 år siden
Is there no one that can help me with this?
F
fljFusioneer
Skrevet d. 10 år siden
This is information residing in some infusion you must have added.

First, you need to identify the table or tables holding the information about the videos added.

Having done that you need to find the structure of these tables.

If you post this information here, you are on your way...
A
afosterBruger
Skrevet d. 10 år siden
Thanks for your response. I changed the infusion_db.php file to include the following which has eliminated the error msg Iwas getting that DB-VIDEO does not exist. However, I did not get the notification that a new video has been added.

if (!defined("DB_VIDEO"))    {   define("DB_VIDEO",     DB_PREFIX."video"); }


As for the video infusion, there are three tables containing the following information.

$inf_newtable[1] = DB_VIDEO . " (
id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
cat_id mediumint(8) NOT NULL,
uid mediumint(8) NOT NULL,
name varchar(200) NOT NULL DEFAULT '',
time int(10) NOT NULL DEFAULT '0',
description text NOT NULL,
video_type varchar(7) NOT NULL DEFAULT '',
file varchar(200) NOT NULL DEFAULT '',
file_image varchar(120) NOT NULL,
file_image_thumb varchar(120) NOT NULL,
url varchar(150) NOT NULL DEFAULT '',
custom text NOT NULL,
views mediumint(7) NOT NULL DEFAULT '0',
total_rating int(11) NOT NULL,
rating int(11) NOT NULL,
total_ratings int(11) NOT NULL,
allow_comments tinyint(1) NOT NULL DEFAULT '1',
allow_ratings tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (id)
) ENGINE=MyISAM;";

$inf_newtable[2] = DB_VIDEO_CAT . " (
cat_id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
cat_name varchar(100) NOT NULL DEFAULT '',
cat_description text NOT NULL,
cat_sorting varchar(50) NOT NULL DEFAULT 'name ASC',
cat_access tinyint(3) NOT NULL DEFAULT '0',
cat_image varchar(100) NOT NULL,
cat_parent mediumint(8) NOT NULL DEFAULT '0',
PRIMARY KEY (cat_id)
) ENGINE=MyISAM;";

$inf_newtable[3] = DB_VIDEO_SET . " (
netrix varchar(100) NOT NULL DEFAULT 'netrix',
columns tinyint(1) NOT NULL DEFAULT '2',
maxsize int(10) NOT NULL DEFAULT '52428800',
width mediumint(5) NOT NULL DEFAULT '480',
height mediumint(5) NOT NULL DEFAULT '270',
color varchar(7) NOT NULL DEFAULT '#000000',
skin varchar(50) NOT NULL DEFAULT 'glow.zip',
control varchar(6) NOT NULL DEFAULT 'bottom',
auto varchar(5) NOT NULL DEFAULT 'false',
display varchar(8) NOT NULL DEFAULT 'exactfit',
ads tinyint(1) NOT NULL DEFAULT '1',
logo VARCHAR(100) NOT NULL,
sub_access TINYINT(3) NOT NULL DEFAULT  '101',
sub_enable TINYINT(1) NOT NULL DEFAULT  '0',
items mediumint(5) NOT NULL DEFAULT '20',
t_width mediumint(5) NOT NULL DEFAULT '80',
t_height mediumint(5) NOT NULL DEFAULT '80',
video_type varchar(7) NOT NULL DEFAULT 'youtube',
logo_position varchar(12) NOT NULL DEFAULT 'bottom-left',
UNIQUE KEY netrix (netrix)
) ENGINE=MyISAM;";


What I am looking for is for autonews to notify the members that a new video has been added. I posted the change to the autonews_data.php file in a previous post. If more information is needed, please let me know and thanks for your help.
F
fljFusioneer
Skrevet d. 10 år siden
You need to add definitions for DB_VIDEO_CAT as well.

You also need to modify the pagelink function in autonews_include.php, but before being able to mod this file I need to know the syntax for the url to link to a specific video.

Finally, you need to make up your mind: Do you want one autonews line for each new video file added, or do you want a line like with photos "xx new photos added to album xxx". The present attempt seems to aim for the last solution, but just want to be sure.

There are probably other changes, but let's take it in steps
A
afosterBruger
Skrevet d. 10 år siden
I assume you mean I need to add the definitions for DB_VIDEO_CAT to the infusiondb_php file like I added DB_VIDEO? That is no problem.

I don't understand what you mean by modify the pagelink function in autonews_include.php. A typical link to a specific video looks like this:

http://babyfritz.fredswebportal.com/infusions/video/video.php?id=2

The autonews line should be like the photos "xx new videos added to video category xxx" although I don't plan to have more than one category.

Again, thanks for your help.
F
fljFusioneer
Skrevet d. 10 år siden
Ok - that clarifies for now. I will revert shortly. You may post the videos infusion here, for me to test...
A
afosterBruger
Skrevet d. 10 år siden
Here is the video infusion.
Du har ikke adgang til at se vedhæftelser
F
fljFusioneer
Skrevet d. 10 år siden
I have tested it and it seems to work for me with 2 small corrections (which I will post later - the first one is to change 4 to 14 in the id and the other is to the pagelink function). However, to test it fully I need the additions you made to the locale file.

Can you submit them?
A
afosterBruger
Skrevet d. 10 år siden
This is what I added at the end of English.php just before the ?>

// Videos
$locale['AN641'] = 'Videos';
$locale['AN642'] = '%1$s: %2$s has added %3$d new videos to the video-album \'%4$s\'';
$locale['AN643'] = 'video';
$locale['AN644'] = 'videos';

I had already changed the 4 to 14 and I apologize for not letting you know. Again, I really appreciate your help on this. Let me know if you need anything else.
F
fljFusioneer
Skrevet d. 10 år siden
It works for me now.

My addition to autonews_data.php looks like:
// Videos
  14 => array(
    'id'    => 14,
    'type'  => $locale['AN641'],
    'text'  => $locale['AN642'],
    'type1' => $locale['AN643'],
    'type2' => $locale['AN644'],
    'parse1'=> 'return pagelink(\'VC\', $data[\'item_id\'], trimlink($data[\'item_text\'], $autonews_settings[\'maxlen\']));',
    'parse2'=> 'return pagelink(\'V\', $data[\'item2_id\'], trimlink($data[\'item2_text\'], $autonews_settings[\'maxlen\']));',
    'query' => "SELECT  MIN(time) AS timestamp,
                        user_id,
                        user_name,
                        ta.cat_id AS item_id,
                        count(*) AS item_no,
                        cat_name AS item_text,
                        MIN(id) as item2_id,
                        0 AS item2_no,
                        '' AS item2_text
                        FROM ".DB_PREFIX."video AS tp
                        LEFT JOIN ".DB_PREFIX."video_cat AS ta ON (ta.cat_id = tp.cat_id)
                        LEFT JOIN ".DB_USERS." AS tu ON (uid = user_id)
                        WHERE
                                       ".useraccess('cat_access')." AND
                                       time > ".$ts_cut."
                        GROUP BY ta.cat_id, uid
                        HAVING item_no > 0;"
  ),


I have modified the pagelink function in autonews_include.php as follows:

// Utility function to format link
function pagelink($type, $id, $text)
{
  global $autonews_params, $settings;
 
  $types = array( 'U'   => 'profile.php?lookup=',
                  'N'   => 'news.php?readmore=',
                  'N0'   => 'news.php',
                  'A'   => 'articles.php?article_id=',
                  'PA'  => ($autonews_params['hsgallery']? 'infusions/hsgallery_panel/': '').'photogallery.php?album_id=',
                  'P'   => ($autonews_params['hsgallery']? 'infusions/hsgallery_panel/': '').'photogallery.php?photo_id=',
                           'FF'   => 'forum/viewforum.php?forum_id=',
                           'FT'   => 'forum/viewthread.php?thread_id=',
                           'D'      => 'downloads.php?cat_id=',
                           'W'      => 'weblinks.php?cat_id=',
                           'S'      => 'infusions/shoutbox_panel/shoutbox_archive.php'[color=#ff0033],
                  'VC'  => 'infusions/video/video.php?cat_id='[/color]
                           );
 
  return isNum($id) && array_key_exists($type, $types)? "<a href= '".$settings['siteurl'].$types[$type].($id > 0? $id: '')."'>".$text."</a>": $id; 
}
A
afosterBruger
Skrevet d. 10 år siden
Thanks for your help. I have made the changes you suggested in both files and as soon as I have a video to upload I will be able to test it to make sure that it works properly. I am getting the attached error in the error log however, and at the bottom of the autonews admin page (and other pages), this message appears.

WARNING: An error occurred while parsing the page. Please see PHP-Fusion's error log for more details.

EDIT: Please disregard this post. Evidently I had not made all of the changes you suggested. Once I did make the change, the error msg went away. My apologies.
Du har ikke adgang til at se vedhæftelser
A
afosterBruger
Skrevet d. 10 år siden
Since making the changes to the files as suggested above, I am not getting notifications. As an example, yesterday I posted a new photo on the site and have yet to be notified that it has been posted.

I have probably done something wrong myself but would appreciate any ideas as to what may have happened.

BTW, it is set to send out notification in 4 hours in case you were wondering.

It finally showed up, but it was almost 12 hours before it arrived. It is going to two separate email addresses so I don't believe it is the email server. Any ideas?
Redigeret af afoster d. 15-10-2013 19:34, 10 år siden
F
fljFusioneer
Skrevet d. 10 år siden
I find it hard to see how this should be the case, but you never know, and I will not reject the possibility. In saying so, I assume that you do not get any errors - it seems like you are checking the logfile.

One easy way of checking it is to restore the original files of autonews_data.php and autonews_include.php.

If it solves the problem of notifications, I have to look for the reason. If not, you have to look. Just to make it simple.

Have you tried the "Test recent mail" and "Show last mail" (wording might be inaccurate) in the Autonews admin panel? What do they show?
A
afosterBruger
Skrevet d. 10 år siden
I will have to see what the autonews admin panel has to show for the "Test Recent Mail and Show last mail the next time I post something that requires notification. At the moment, the "Test Current Email" says:

To: +16 recipients

Date: Tue, Oct 15 at 16:07
Subject: (No mails sent, because of no or too few news, or because time for sending has not been reached)

and the "Show Previous email" shows:

To: +16 recipients

Date: Tue, Oct 15 at 16:06
Subject: (No mails sent, because of no or too few news, or because time for sending has not been reached)

I have left out the "From" for security purposes.
F
fljFusioneer
Skrevet d. 10 år siden
The "Show last mail" is intended to show what was sent last time news were sent, and "Test current email" is intended to show what would be sent now, if sending was due.

The fact that none of them shows that a news are due for sending, is suspicious. What are your setting for the number of news needed to allow sending an email?

I suggest you try to create some test news, and confirm that you can see the news mail to be sent in "Test current email".

If this does not resolve the problem, I vote for the "roll-back" solution to verify that notification does actually works. This is easily done as it is basically just to but in place the original of the two modded files.
A
afosterBruger
Skrevet d. 10 år siden
Thanks again for your help in trying to get this resolved. I have posted a news item as you suggested and the following is what I see when clicking on the "Test Current Mail". In answer to your other question, I have it set to 1 news item for the number of news needed to send the notification.

There are new updates from Angela and Tim's Baby Page

If you have to login when clicking on a link in this email, please login first and then try again.

Wed, Oct 16 at 07:37: admin has added news 'Website Update'

Best regards

admin
Mail generated by autonews/PHP-Fusion on Wed, Oct 16 at 07:31 - Unsubscribe to autonews from Angela and Tim's Baby Page

I am getting notifications (at least I was notified of the last photo posted), the problem seems to be that it is not being sent within the 4 hours that it is set to send. I will post again when I receive notification of the news item I just posted.
Du kan se alle diskussionstråde i dette debatforum.
Du kan ikke starte en ny diskussionstråd i dette debatforum.
Du kan ikke svare i denne diskussionstråd.
Du kan ikke påbegynde en afstemning i dette debatforum.
Du kan ikke vedhæfte downloads i dette debatforum.
Du kan ikke vedhæfte downloads i dette debatforum.
Log ind
Er du endnu ikke registreret bruger? Klik her for at oprette dig.
Glemt kodeord?