|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////. G& C0 d, i& L" V, |
// Theme Option4 R. C* ^8 T3 \! `7 c& \
////////////////////////////////////////////////////////////////////////////////
. a0 d, q/ N1 _8 n4 V1 \5 B
S9 S( v0 d, {$ s o$ Z- {$themename = "Zenx";
* A3 R5 O: T; F2 A/ g6 R$shortname = str_replace(' ', '_', strtolower($themename));
4 h+ _+ e+ P; ]4 |4 ?6 z; e
4 ]' d2 M- M$ r( D2 j- k+ s+ H; Yfunction get_theme_option($option)3 U7 m1 F9 O0 \8 D& \- h: u5 _
{
5 g$ U: e' d2 `4 K P global $shortname;; h$ L. k! l) s2 j2 S$ y( I! N
return stripslashes(get_option($shortname . '_' . $option));3 ^; R* F$ C4 z# @2 @' V1 f3 e6 F
}% e7 D! b4 E3 Y) p# H' o5 |2 N* e# E
+ [/ t& d1 V! f! ^6 sfunction get_theme_settings($option)9 h9 r) r4 o. i% V# `1 a9 j" |
{
9 s3 ^, h w' u8 h1 [" d9 D- y return stripslashes(get_option($option));# ]& {& k/ Q' d5 s2 Y8 g- S/ k
}
: H" @0 Q3 e' R( W$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
% ~( ?4 t4 j9 \, ]2 q5 P6 N0 w$wp_getcat = array();
3 c0 \& m" S( ^& ^, xforeach ($wp_dropdown_rd_admin as $category_list) {" A j3 y$ g& o$ J
$wp_getcat[$category_list->term_id] = $category_list->name;
5 b1 A) ^! V0 |}& d% f" ]- |9 q; Z9 i
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
: X* s e8 c& P" ]5 W0 R$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
6 k1 I6 f: e7 j, v9 ?& f- a1 Y$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");! H" ^; D0 p( A, |% U
8 J7 v. c! l/ L [2 v/ y- C5 r0 ]8 p% i2 @$options = array (
8 e2 f2 U6 X! ^4 \' A( g. n) O/ e0 q* l! T/ `: x+ z O8 ^
, {8 K: ~' M5 e& Q1 v7 M& |
array( "name" => "Blog Header Settings",
! {6 K. K2 m6 h) `" k' m3 D "type" => "heading",
. F0 e8 q0 ^# j# i3 e% e3 b8 w ),4 i5 R! g' y* O; @" J
' D* @0 `# ?$ Z3 C8 e/ R& t& [4 X
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
6 E$ j) `# s3 A0 l' k "id" => $shortname."_header_logo_activate",4 h" {7 a! d9 m$ V$ _& k6 L2 `% F& a
"type" => "select",
$ z2 z1 c6 S' W; z- Q1 [5 f+ E "std" => "No",* E0 p7 j3 h3 _0 x- Y: @# c6 L6 p# g
"options" => array("No", "Yes")),. |. L4 v/ a) q1 _! y; [
) @% l1 v$ R5 D) N# d4 @ array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
. e5 w% |: v% k6 k4 N1 g "id" => $shortname."_logo_url",. [$ \+ l) `' V0 ~% P6 S l
"type" => "text",) i' U8 t3 r; X' ^1 D3 Y1 F. P
"box" => "social",
5 D: `) r. R! q: i "std" => "",/ P3 Y2 [) e W* S% q
),
" [* ~9 u: T7 V* m
5 ?' T" W. y t. c. \0 L array( "name" => "Insert Header Banner HTML Code (Header)) `* `$ Z. `. C
<br /><em>*Recommended Size 468 x 60</em>7 ^2 e. L$ A- g9 d! ~9 X$ M3 ^
<br /><em>*leave blank if not use</em>",
! ^& M) O7 Z& `, L4 U4 b "id" => $shortname."_header_banner",
$ \2 a/ {! t* X/ k! Q/ [) f "type" => "textarea",
& G. p' s% Z$ c( Z, R "std" => "",
. `9 g- l/ t+ q8 Y' b0 e ),2 j4 C7 c% K+ {: y, x2 {" r
6 G0 b( l- J1 U' `' E
array( "name" => "</div></div>",
* p/ `1 b- y2 b x( {+ J1 g/ J7 G "type" => "close",
% Q8 z* H/ n3 {3 X+ t ),: [ _* T. c8 Q% j& [$ S
9 n9 d- A4 L- H- v, i- P v# l* K3 ?4 b
/ R& Q, r: C" g- e/ `$ j
array( "name" => "Header Navigation Settings",5 O7 c i4 \, w: e! w, G0 U/ `
"type" => "heading",
$ V9 S/ L# D, ]4 [; r3 Z' j ),
* \6 a6 R" k( A/ Q, ^0 P' H9 [$ T
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
+ H5 v; {) I8 A! ?4 Q7 ] <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
* h0 e1 I& U9 ] <em>*Enter the page post ID number only</em><br />0 r3 N- M+ g* l
<em>*separate by comma</em><br />9 V% ?: H, W: R4 N2 y; I) g
<em>*Exclude pages which you don't want to show on the header navigation</em>",
. B! K$ S4 u4 V1 g2 [- k) Y# L "id" => $shortname."_header_page_navigation",
/ G8 A& M* G) p7 `6 R: c2 W "type" => "text",
9 z5 y, E1 E' R% g" b, w "std" => "",
+ [$ H3 I& a# f ),6 o" F% d& {, R) b( e9 Y
" {8 f# S' n0 c5 _) p
array( "name" => "</div></div>",/ q( b0 G: s/ Y! N' j" Y
"type" => "close",
! m. j( A0 L. |: b2 ]: i: ~ ),3 F; z! A* Z% P, o
3 _+ U6 F/ z3 p- n# k
0 \3 V4 C0 U. p array( "name" => "Post Auto Thumbnails Settings",6 Z+ e* ?1 R; D- q% D x
"type" => "heading",
, X. S f6 A) Y) I9 `5 G- | ),
4 l3 v9 c% J5 j6 \3 X7 _! g# ?/ k ' V% S: o( b' M
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) e/ \6 _' m# C3 @6 g* p2 a
"id" => $shortname."_timthumb_activate",
( p/ a) } l& Q) E) K& Y; w "type" => "select",. F) D( i8 o6 C
"std" => "No",
# Q; V* F1 _, v! I5 B3 _ O: L; L- ~0 E "options" => array("No", "Yes")),' z" ~/ J, H& P
}6 B: e- c+ i
array( "name" => "If Timthumb is enabled, Please choose its cropping method",* h2 h# _' F* S' S9 h
"id" => $shortname."_timthumb_cropping",6 e3 P3 A; A( h# t7 Q5 X
"type" => "select",- b; \2 C/ W3 I9 B
"std" => "",% P5 Z9 I: p+ ^( _, z6 @5 v
"options" => $crop_position),7 r+ c9 T% ]( B
: X& Y F1 p: p2 f& i) e, g4 [
array( "name" => "Insert Width Of Thumbnail Image<br />
$ y3 p6 H- C6 Q9 S <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />9 v# |4 B0 U; b' t
<em>*Leave Blank To Use Default: 250</em><br />",$ ~1 j/ U/ m7 m8 }" `7 G% r, h
"id" => $shortname."_thumb_width", b3 m/ `) v w( f) g
"type" => "text",* l$ q6 j7 s! e
"std" => "",* ?2 j8 X6 y+ ~0 ~: X* r% {
),3 v6 \4 ]- @1 i6 Y; N$ q/ s
' w7 i3 M$ d5 K+ R0 z array( "name" => "Insert Height Of Thumbnail Image<br />+ S9 c( ~9 d+ ]4 i
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />- ~( q& D4 R! c) E9 s
<em>*Leave Blank To Use Default: 200</em><br />",
g3 V' G' @4 _. Q; [( b "id" => $shortname."_thumb_height",
9 Y$ L. \5 s' ~0 W( z @. b "type" => "text",% V% S0 o; W8 m4 x
"std" => "",7 ~- p) N8 {4 z6 |( G
),
) I, i* e) j) u1 u+ D8 {8 B3 Q6 |" g% \5 [* N0 S
array( "name" => "</div></div>",
- G7 r: {" Q5 F7 | w& H "type" => "close",
, M4 H \" d0 j) _" e% m3 I- @& t ),
- [' V2 Y) L7 i+ q, M+ ^5 X
( x4 c/ K6 n% [5 X; j9 G array( "name" => "Featured Content Slider Settings",, @8 @4 r, v( J
"type" => "heading",
4 l3 H( h: A, {: a# j6 J ),. ]- a& d6 ~/ q6 H/ p6 V
3 L% B, V' O8 |( X9 w
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",7 l J' V4 |4 Q5 \2 Y$ P ]
"id" => $shortname."_featured_activate",
1 |/ `7 m# Z' ]6 Y8 R "type" => "select",* a$ Q( c0 D$ w
"std" => "No",
/ L3 G, O$ n7 @; z# o "options" => array("No", "Yes")),
" m3 ` l+ h% K* G0 }
% z1 q2 l; J. W8 w
0 R/ B5 C- ?$ c: ^* v( O# j array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
( ~+ f% S3 w0 u4 g1 o "id" => $shortname."_featured_category",
+ c' g2 {9 @2 Z t' y "type" => "select",
/ p4 O+ r4 W; X8 D "std" => "Choose a category:",6 g3 B/ o% M6 P3 p
"options" => $wp_getcat),
% W9 V2 g' Q" v8 L5 k( H- i" n* |5 P2 m8 ^) w: D' j$ ~& f; u
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",+ J T. L1 L3 q+ o
"id" => $shortname."_featured_number",/ D0 R* c1 z: Y2 h# c5 h: V
"type" => "select",
$ U$ P' {; G' a. g2 @ Y "std" => "Number of post:",9 n: W; q, T& S* k7 l5 P& R8 l: ~
"options" => $number_entries),/ A0 Y5 |0 K. ]
9 `- P0 ^% f7 T$ E/ b
array( "name" => "</div></div>",
1 m4 K( w- X" g$ W "type" => "close",
# g2 p! ?2 p! h ),! F, m" X N: R2 G4 Q0 O
- K& v9 |% E/ H/ L6 @+ R& P
array( "name" => "Featured Category Settings",
0 J# {2 N& d' l+ z3 R "type" => "heading",
! T9 h6 G# o' A" O% k" t ),8 G8 p3 R6 v `
% ]9 s# z/ O% s* D array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
. S* u" ?: S* Q$ ]/ W "id" => $shortname."_featured_category_activate",
# n4 M9 u$ m. g2 T( l+ z* W "type" => "select",- ]! E4 ]% u( \# P. H
"std" => "No",) T. ~. o) M: Q# d% R8 _
"options" => array("No", "Yes")),
* m" h' e6 _& |6 h6 N" j: i' ]' c
: d2 a2 H; O% @! R array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
- F! S2 g+ @) T7 q: ?8 O "id" => $shortname."_featured_category_id1",
4 X; o8 Z* q" J' N- l3 d' ^ "type" => "select",
- a9 ~+ T8 m0 c* j, J# F "std" => "Choose a category:",
9 N' X5 K. B8 B1 l/ @ "options" => $wp_getcat), h+ K" Z2 {6 Q3 X3 E
! Y4 ?0 c6 z& g1 [1 L* ^ array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
; B5 L. [9 R5 n7 X0 i+ F "id" => $shortname."_featured_number1",# o5 k; a6 U0 Q+ d
"type" => "select",
# w, j5 v& v( j8 W) R, R "std" => "Number of post:",
5 X! i2 ~! W7 e* h4 V( i. ] "options" => $number_entries),5 ]: a; S, v* T7 D/ k
( C1 }5 m- ]: ]; g4 w$ K; { array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
6 [- y$ Z8 q* D0 I3 r; T "id" => $shortname."_featured_category_id2",
" d' S& b. E2 `, S( S4 |" @ "type" => "select",
5 q# W$ k) ?( s9 a& R% a "std" => "Choose a category:",, S* O3 }7 Q, k8 X& C
"options" => $wp_getcat),
* C, ?; g' X# O; I, E2 h4 q & S4 Y7 J1 J9 [1 I) F
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",! a, f* y; A7 T# z7 r4 ]
"id" => $shortname."_featured_number2",0 {! t6 L! L# u {: I
"type" => "select",
9 r( g/ Y# s P8 E4 [ "std" => "Number of post:",
. j7 @. N: r3 o$ N$ @ q# t "options" => $number_entries),* l, m ~. _+ Q. R8 M$ W
2 k$ F8 d0 l3 K7 Z% ~+ s0 ` * K7 l+ ]6 X2 a: v# A! _+ E; k
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
9 E: |) }$ u/ B! [ "id" => $shortname."_featured_category_id3",' `! J7 w8 G2 ~9 d V) I* U7 m
"type" => "select",6 L9 s. r3 m/ N6 C, F' a
"std" => "Choose a category:",
+ ] z# \- W" Y; M& | "options" => $wp_getcat),2 t/ Z, I" [! I$ d# H
5 @& F6 L( r& F, L" Z9 T3 X9 S array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",$ b% g) p/ c- K& O4 \, |
"id" => $shortname."_featured_number3",
% P8 ]- D$ x: P+ V. W# Q "type" => "select",
% S" A! x2 m r9 N "std" => "Number of post:",
a! N: k; Z7 q3 a( ? "options" => $number_entries),0 f$ @+ y1 y8 U3 `
' w( [+ X. B% ?: I) ]7 Q
8 z; X/ w4 q3 b2 c( I array( "name" => "</div></div>",
+ ^6 `* w9 p; {$ H$ F5 K' z "type" => "close",1 Z5 h, G: ?4 H' W
),
: F0 \( K8 ?, n8 S* r& Z& \% O1 Q) L$ E" t3 Q- y
0 m( z. b1 r/ l7 b array( "name" => "Google Adsense & Analytics Settings",+ l: O* }4 j7 s2 b7 j3 H
"type" => "heading",, }4 k) k$ I! @. r% d
),
, ]$ e5 I( G" A9 `4 q
$ H# z5 l% g9 `8 Q0 V) G& \0 Y3 k array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",9 {$ R3 s% E+ T/ j( q$ P$ G+ E
"id" => $shortname."_adsense_loop_activate",
* Q$ _7 D P7 b3 W! b "type" => "select",
* Y! P* S# {- J5 P' J; I L "std" => "Disable",' P: u: F% p5 m
"options" => array("Disable", "Enable")),. V0 ` _, H0 ~8 o, @" u9 q$ m C
0 ?/ ?/ w/ G% f# l2 \+ m. S
array( "name" => "Insert Google Adsense Code For Loops Here<br />
8 q1 A+ S% @: `+ [( \ <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
3 H% X6 Q0 n6 |% L "id" => $shortname."_adsense_loop",1 d g" g( `2 K+ x! h
"type" => "textarea",8 a' W$ d% Z5 S# d/ y
"std" => "",* L- Q6 P: e' {- K" @' u+ D
),
/ W, T+ g+ A. w
0 ^8 |7 T4 P6 k7 E array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",2 f- m6 I7 M2 [5 @( |- r
"id" => $shortname."_adsense_single_activate",
: x1 n k) u! x. N& Z" `, b7 M "type" => "select",
1 U" H6 T; |4 V: j3 p "std" => "Disable",- z M0 b6 q5 F3 G
"options" => array("Disable", "Enable")),* I6 v& j$ f% N0 Z! _% A
8 N( I# h! z6 |8 Z' n array( "name" => "Insert Google Adsense Code For Single Page Here<br />
& P X/ u% @8 S1 C8 w& A6 k0 H0 i <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",! L0 d# m$ d( b1 n* a! B" R- {
"id" => $shortname."_adsense_single",0 \) k- T' {; q4 u% s0 @
"type" => "textarea",
- }- P @( K M: N6 t4 L "std" => "",, x0 R$ ^) ?! Z+ w; R
),
4 a5 I, ]) v, d# q/ y8 v% P& ~- i2 T4 x& a8 a5 N$ \
& X+ Z$ h" O& N4 M
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",7 ~1 T! [1 [/ |$ s' I5 I5 }
"id" => $shortname."_google_analytics",* `9 L. K( |0 {9 ?5 J2 g
"type" => "textarea",) ]; |3 k) J6 O/ a7 g' ]6 v
"std" => "",$ ]) M. J# A- G( S
),
8 v$ J4 n0 H3 J" [6 z" ^, \& T) M- `) \, {# U% X
array( "name" => "</div></div>",6 e, H7 E0 C/ r$ B4 l
"type" => "close",
& x) X0 N; h8 R5 N, X ),
2 V3 [# h7 }; \/ L
3 d t2 e& A, v' \" ~) F. c, L; R / [! i' C( O( ^1 T, B
array( "name" => "AddThis Social Bookmarking Settings",% L8 b& \- C5 w; b: m4 ?
"type" => "heading",
1 W: J& X0 Z& Y( H2 L ),
- |/ J2 g& C8 e) p6 ], D1 s0 E, o9 B8 G. P# [- `: b
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
3 j. W2 B4 F2 h ~' q5 Q <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
: a7 t9 e6 |, u/ l- Z3 G1 Y "id" => $shortname."_addthis",7 |7 Z7 A8 ^/ P4 L* R6 }
"type" => "text",, y! n/ T! S1 r
"box" => "social",
. B: t; f, D8 G6 _2 q) l. c "std" => "",
. e7 h3 h) @, {. S$ o, ]; G; a ),
: z7 K5 f8 n8 J" H# J1 d E
1 O3 B F2 i/ t array( "name" => "</div></div>",9 e2 ?+ w0 W4 G# F$ `( t
"type" => "close",
2 j& f7 k3 |- a6 d ),! g! y+ A [/ J5 M
2 M" H0 h* c. J y# k$ b& v, B! ? 2 K- k5 Z. x& a5 ]
0 F8 R+ h8 k- q. {
array( "name" => "YouTube Video Settings",
$ }% {- ]* d; `7 j E "type" => "heading",: A7 u6 a; Y/ D& o* {, `# x
),; t& |* O# P1 D; e
, Q' V- O5 u5 S8 P T8 t, V# C: \ array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% ~3 {! N. @7 ?+ H4 c7 `1 } "id" => $shortname."_emvideo_activate", ]+ A* e* C1 B9 W& ?+ m
"type" => "select",8 u4 Z6 q. `0 ^- C# p" j: i
"std" => "No",
% h$ o5 |3 J3 X; V m! N "options" => array("No", "Yes")),2 A6 u! ^8 q4 j/ x
+ n: h+ h6 H) t
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",
; ?* [& E/ ~, j8 C, Z6 S "id" => $shortname."_emvideo",0 F8 B; l1 |9 c# q- i: y
"std" => "",4 q2 m8 C, n" T/ O5 \
"type" => "text"),
. r% ]- P8 o4 p* P3 A/ a* `/ F7 ~. n+ I; {; i# }
array( "name" => "</div></div>",3 C. L0 V( F! Y) f
"type" => "close",
: ]/ I& |+ L7 i6 l6 L. L3 \ ),' \8 o. Z+ F N# p% g2 G- }
) y' u$ ^+ x: s
array( "name" => "Twitter Settings",
/ W3 d6 v" ~% f "type" => "heading",7 _1 i; i: L# O( u
),& `# r% W% K O, @8 T
' N. `. G" K7 v3 { array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
$ Q* T" F& x0 y "id" => $shortname."_twitter_activate",
; ^- c( n" B' p k! L9 w "type" => "select", s0 p L2 v+ A! X0 r0 [
"std" => "No",* O) f( w& R2 u7 ~
"options" => array("No", "Yes")),7 m7 E3 T4 ]% T
" R8 W: ^, D' u+ q
array( "name" => "Insert Your Twitter ID here
! H& e1 k2 \5 Q0 G6 d& M6 n$ m" r <br /><em>*leave blank if not necessary</em>
" {# Q( c- C" V. \ ?, g <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
! f6 x' U2 H) K! [! f! c& e "id" => $shortname."_twitter",
( B/ n. f2 _$ e( Z+ ]6 B "type" => "text",0 E7 P* X) ~# r ]$ A( X: z
"box" => "social",0 X0 W1 Z+ d) V# r" P
"std" => "",6 b) k: i) O: q- l# I) Z
),
8 j, K5 f& s3 f" V& B
, H, p/ ]+ w8 E- c1 o/ R array( "name" => "Enter Twitter Feed Count here3 B( V9 x# n" n8 {# X
<br /><em>*leave blank if not necessary</em>
3 v u8 {7 J3 e, F <br /><em>*Enter How Many Twitter Feed To Display</em>",$ e/ @3 m B, v6 k0 g( s' E' V4 D) L
"id" => $shortname."_twitter_count",% t& r. G: y" n, P& W
"type" => "text",- }. `% J! D: E* p6 W! k5 F% b3 W7 @
"box" => "social",( J3 {* J: v, u- q) F
"std" => "",
# Z+ S" T7 p% |, P+ @- B) Z ),& W4 ^8 I/ E+ |! k
* l: I6 O9 f! E7 F: u
array( "name" => "</div></div>",
~6 D3 w. n/ F l4 _ R& h. Q "type" => "close",
% l& z9 Y" B4 J ),
- X4 S7 b8 c: N0 g ' `! K1 T$ Y& [% T
' ]5 z* T3 | t) W4 |
array( "name" => "125 x 125 Banners Advertisement Settings",. `8 d. d6 E% B4 E8 a
"type" => "heading",
6 Z! ?( x8 d- }3 |3 w/ [5 x& i( G ),
7 A3 R: u: g0 a2 W
$ c% Y8 V: \! s: a array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
# o, V: U! }8 c3 Z0 q0 _, Z "id" => $shortname."_sponsor_activate",% l$ t+ p. B0 e+ R; M9 b
"type" => "select",
4 k: F; N; r( j, `7 q2 Q "std" => "No",
( @5 j" E9 A3 T; a "options" => array("No", "Yes")),
! d2 y, Q9 A# r0 B% M6 K
% y* F% m( b5 C. t1 d# z
' g. F4 h; O# x# v array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
1 P8 {, w* B9 j7 d$ I0 j* r& r "id" => $shortname."_sponsor_banner_one",+ Q9 [- S! r& L$ [2 D4 O
"type" => "textarea",
1 V; E2 J+ H+ ^ "std" => "",( M& u: D( t! ?2 u
), 2 c2 D6 o3 D; l- S
) f+ ^+ F7 I d( {
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",! l* G P5 J; Q# I+ C6 e
"id" => $shortname."_sponsor_banner_two",
9 X! s$ O! ~+ o1 Q& } "type" => "textarea",6 L R& M, N& s$ w
"std" => "",% k% o$ |% @) I" ^; I' |1 G
),! x- ~' q- _- T5 p# I. s
) y) X# O6 `% ?+ H0 q array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",; P- t. z; m3 h" m6 a
"id" => $shortname."_sponsor_banner_three",& \2 k+ F# P2 ^: n5 Y
"type" => "textarea",
% i! U, r2 v6 }% ~" I1 s) C "std" => "",0 Z; p1 A) M6 D* k) S! O/ k
),7 B- S p" v8 `6 y6 V+ e9 c
5 o; x j1 V+ z, @, \+ @ array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
% j. y2 k/ @; V" k6 q/ \4 P- H "id" => $shortname."_sponsor_banner_four",5 P, N3 y, }2 C
"type" => "textarea",
w6 T% J- H* I' W "std" => "",6 Q* \+ U9 U3 P6 K; p: F- z9 [
),, {- }, L5 `( ?
" J$ B2 n: p; z6 I S% s; B2 F7 s
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",; Z: Y3 a, k f: m$ X
"id" => $shortname."_sponsor_banner_five",
3 Q% X F- h: v9 \ "type" => "textarea",
( O% ?, c& p8 j "std" => "",2 G9 {2 @6 f. w& v2 O
),
5 ?) f$ V6 V6 ]% K) T( S4 M
& @$ W, d" o* [ array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
' {4 N2 D5 V0 M& N* Y9 Y( [ "id" => $shortname."_sponsor_banner_six",
( J/ P, Q; L, q5 ?3 f5 R "type" => "textarea",
& q8 f/ V* @, e "std" => "",: d" Q( ?2 k. t- }8 f
),' d. O, ?8 Q! u$ W* {: v; I
& O$ s0 E, J" L, K w1 l/ b
array( "name" => "</div></div>",
' w, j& s2 z; z" l8 a "type" => "close",
. ]5 L3 x. s3 J1 ~* U4 r. S ),
% F7 U3 x" K6 {* o4 K$ g
. Z4 j4 ~8 \- s5 h
2 L" A: x1 K1 |5 Z: ^+ S. J F3 p% k
6 t$ k/ S5 |0 `% ~ O8 ^2 j);
( n( a9 Y) G6 z. a, Q7 h4 A
$ U. o; F' N4 nfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {: `2 k2 l1 r, Z( Z6 \
$ m. j6 D0 f8 b Q3 x
echo "<div id=\"admin-options\"> ";. }1 Q V$ B; X6 J+ w4 V
3 m) M7 L0 f9 ^7 ]6 ~
global $themename, $shortname, $options;0 e' ]& x' [8 ?! }4 f6 o9 t/ L
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';% ~9 s- S& H" _( {5 n
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
/ g% J5 d& c7 B. A. e) B?>+ X6 d' N w6 Q& A% e3 c' g" ^7 ^
% f0 Z5 q, ?3 `<h4><?php echo "$themename"; ?> Theme Options</h4>
; C0 b& f- L/ `6 I, V
$ L6 q- _& n7 V1 ~, K) N. d& u/ Q2 @<div class="annouce">6 d& k1 W' i, q# V/ w4 |- b
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
g3 Q3 x7 f/ r: W; h0 C$ s. i<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>( g s) F+ k9 U0 m7 }& W- m
</div>5 H2 \$ K! p M# L
% S$ K6 h% ~8 ]) x' @$ U0 V<form action="" method="post">* k7 D, _; P! y' o0 [4 y
+ A4 u$ P( {4 v. ^& m8 E( k5 u<?php foreach ($options as $value) { ?>
% `7 b$ P, f1 X S( i
, x) }( O5 ?. z% u<?php switch ( $value['type'] ) { case 'heading': ?>
# w2 D- {% r# n- C2 G h* d- N/ I+ t; W9 y# |7 ^
<div class="get-option">
: B6 T; |/ }- L- G$ H3 `4 V, }) A0 i; {# H5 ?( C& Z, d
<h2><?php echo $value['name']; ?></h2>
* Q: v5 h: y, q" [' s1 V. P5 t! F0 _* i3 U. j5 N0 i
<div class="option-save">8 ]! W3 z" H5 h' ]) x% _9 R
: p0 ^4 q" I4 _7 [; P& L( U: c
<?php8 M- N4 H+ Y+ m3 A" Z* ` |
break;
3 Z6 C5 q* p' n# z- dcase 'text':5 D* Y4 b* o% M/ X. x! Q; F, j
?>
. y* Z5 F4 Q' v$ g1 F+ v8 L' D3 ~$ S W7 R. m- l
<div class="description"><?php echo $value['name']; ?></div>& n& K! U0 q& {0 z% p, z1 o8 g) }& G
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (" Z: X4 U) y7 } f' ^
. e, h8 o6 n+ D4 h( u( z% ?
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
9 t y2 r6 B' I+ Q; [+ M! r
m% y) |) }2 ?. x* r+ U$ l/ l* ]4 J<?php& m8 }7 n! D9 X, W" A* K) {5 ~
break;( C& ~3 m7 |$ F% |5 e7 }
case 'select': N! H/ e6 x) t0 K7 ^* w3 \0 k
?>8 ?( @8 m2 D2 |3 ^" [7 U
& q/ ~6 k/ ?! P<div class="description"><?php echo $value['name']; ?></div>/ S7 C. W, m& s/ C
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">- E6 \4 ~+ B& E- G( S
<?php foreach ($value['options'] as $option) { ?>- a( a8 g7 x) s0 i) R
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>2 s( H7 O+ ~6 l" L& J8 T6 G) Y8 _
<?php } ?>& e) K& [; P7 X5 H
</select>8 C9 i. H3 y% p8 T
</p>
' t, N5 ` Z) @& k2 D; K
, h9 }$ H2 }2 n/ a2 `7 T<?php
& V7 ~" d$ I! y* Y& x; Abreak;) {9 A) O5 |! j7 a
case 'textarea':- m% s; k& _' \, X
$valuex = $value['id'];
5 O0 L% ^ z/ z8 J- d$valuey = stripslashes($valuex);. ? f4 F7 N7 J1 e! ~! f
$video_code = get_settings($valuey);8 X: K4 D& o1 m* m* n
?>
4 |3 b. Q/ n- I' J' o% a% x9 i7 g( f0 U( [, L
<div class="description"><?php echo $value['name']; ?></div>
8 t( H4 D, F9 t6 \; ]; e) t<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
7 Q, u2 i9 U. f: V, q( e
7 j6 ~- ]; j0 Y: J- W+ w2 `else { echo $value['std']; } ?></textarea></p>
. G i, {& D! x/ u) h6 s
: I' f) Z2 [9 d7 ^<?php# F* R8 M7 _1 p- q% |
break;6 @ ]1 S( U5 n) s3 A! H; H
case 'close':
6 i' k" D; p: S6 `?>
8 w. p/ ~/ E. G8 e3 h" t s( e. [+ ?! n7 e
<div class="clearfix"></div>
F7 f( G a4 U! O</div><!-- OPTION SAVE END -->
1 j6 Y' R8 l, C5 d2 a6 X
( {! R' R8 e3 T: g) t<div class="clearfix"></div>2 p/ D6 F: o) p
</div><!-- GET OPTION END -->- ?0 B+ l4 {7 I. S! i8 l8 m
) L1 V0 w9 t( R! s$ T
<?php
L8 H: x& ~& S. s) R" M6 Dbreak;
2 ~* t7 I( k' A( e6 ]default;
; ]8 x1 A, X' _! O8 W?>5 G" T) t4 [0 V: j2 L1 q- B
8 [- z: G) }3 c! Z( s* n; Z7 B* q. }
<?php
+ L; ?5 ~5 R, X0 b3 ^/ ibreak; } ?>0 d* Y+ M) n) m9 n+ {4 _
$ _0 l" o9 }3 @: W$ Q+ m+ \: p$ \; C
<?php } ?>; [- E+ ?( K0 } f! l
' x, m- l1 ~! C! ?<p class="save-p">
9 U" t$ K$ n8 d5 N<input name="save" type="submit" class="sbutton" value="Save Options" />
( _) Y- r4 F5 j7 [<input type="hidden" name="action" value="save" />
/ F& g# ?9 x0 S: a9 X7 R</p>7 w h& k4 V$ J3 R. Z1 g% _
</form>% \9 N/ `& Q- `9 k3 n
+ Y' m0 j" x0 x. Y6 T" z
<form method="post">
6 Y" I# z, b |4 {, e<p class="save-p"># c9 M: R7 {! P* u" ~6 _
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
" W' j, v- O4 ^; E: q. {- t<input type="hidden" name="action" value="reset" />: L d0 t+ ]5 b8 W
</p>. F/ h. C, M& b$ f5 E
</form>
1 j9 \& |% j2 t+ i0 M1 D/ y; B
: D# U2 }% L- I% f1 {1 \% x& d</div><!-- ADMIN OPTIONS END -->
" W' s) D+ Z9 b% z/ {! y% z/ j$ }4 U; p7 t
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
! P6 X- \+ h+ u) T) E* v$ `4 O7 c b- C
function mytheme_admin_register() {. Q6 M- T9 L1 A& A
global $themename, $shortname, $options;1 U( `* I9 P: f, ~9 ~7 l
if ( $_GET['page'] == basename(__FILE__) ) {; X" H5 o* O, p* P; @6 r; X
if ( 'save' == $_REQUEST['action'] ) {- ?2 u- y. T6 l
foreach ($options as $value) {! G$ T- L: H6 b0 U
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }$ B! e5 ?0 M: ~# ]2 G! Y
foreach ($options as $value) {
Y: a9 M5 O4 X- Q. b1 Sif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
* r8 f7 g2 M& }header("Location: themes.php?page=functions.php&saved=true");
2 p" ?) o- Y- a5 q: O7 |die;
/ a) T2 M2 s$ T' f/ X T} else if( 'reset' == $_REQUEST['action'] ) {; k2 n1 S3 G' V
foreach ($options as $value) {! F( X# Z( x8 @; h# V
delete_option( $value['id'] ); }
9 S( z, p J! O* w8 r6 @header("Location: themes.php?page=functions.php&reset=true");6 T. z0 M9 E5 U5 L3 I' q. F' O7 w) v* a/ n
die;
% \5 Q2 A% r& e8 n) d}+ m2 f6 W: y {& P3 M
}0 [, O/ Q6 G4 E, {
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');% E! P. e; ~* l" Y0 X
}- [; x0 k/ B. g- v
/ H) d( i$ Y1 K" c
function mytheme_admin_head() { ?>, b {3 x1 p0 X9 g
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />& }5 r, G2 z1 m( z! U
<?php }, O, W5 s* @; i3 D& b! s
|
|