|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////0 W. L+ n! A( F. n j
// Theme Option
2 Q) e/ E: S% Y; z/ ^" z5 Q////////////////////////////////////////////////////////////////////////////////5 ?- L! f1 B) C' K6 R0 \ B
" X# O/ H7 G+ E: |" @. ~. ]1 @. ~$themename = "Zenx";
4 _( j( w$ ?8 \( ]8 w$shortname = str_replace(' ', '_', strtolower($themename));, h% j7 F& J5 v$ s6 ?' } g
9 D1 H0 T. f+ U- h/ bfunction get_theme_option($option)$ O% }" l2 h; j5 J
{5 [' P( T7 f1 D9 H: @# I8 u
global $shortname;/ ~6 k7 J* v# ~ F
return stripslashes(get_option($shortname . '_' . $option));/ K2 ~# A# F, W; `1 q
}6 U" N/ ^- I+ J6 i1 Y, v, x7 {! O
2 X- G$ n/ \) h; N2 ?; ?function get_theme_settings($option)
0 M }" y7 n, _1 B V{
8 a# d" [: W5 j return stripslashes(get_option($option));
" w6 R" {, L% j8 E}+ n" o8 [5 g! G1 Y1 G* I1 E$ z( M
$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");' y/ `% g% E+ t
$wp_getcat = array();$ i7 X& _2 h' M) n# b7 f
foreach ($wp_dropdown_rd_admin as $category_list) {
. ]: {9 P: V& `' N2 S$wp_getcat[$category_list->term_id] = $category_list->name;
1 p" q2 R, Y& m( r& d}0 Z6 M/ n2 \4 a! f, Q/ Y
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");2 y1 v! E( T0 a& c, @& q9 i7 K
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
9 ]* T; K! G5 N/ O+ u% g$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");3 x7 U$ n) ~9 Z) h5 t+ [/ p4 ?5 j
0 R8 r1 ^5 S1 o: p% [3 \+ I) F$options = array (
6 i9 d2 N' Q0 J& [6 o+ R% \- o' h5 d: I% X$ z1 }- w1 D
! n$ R! @) D' u( [5 S array( "name" => "Blog Header Settings",
8 m+ V* C; r% \, ?' f "type" => "heading",
% b! h; _2 Y9 | ),) X+ D$ z: ~7 b
' Y# `$ S' z7 p6 c+ N array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
. Z9 R% v S5 H! V0 _7 v "id" => $shortname."_header_logo_activate",
6 x g" r- K- n" |4 _6 A "type" => "select"," \" e/ ~. S" R8 }* Q- g) L5 P
"std" => "No",
h7 g' V, ^5 K' P$ k6 X/ O "options" => array("No", "Yes")),
X% C- @! s4 T; ?) u% w6 S5 c M
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
$ H. B9 O2 j! G d "id" => $shortname."_logo_url",* `' u v5 M* h7 S
"type" => "text",
, n) L0 x& L: @8 l "box" => "social",
' C$ m0 v1 G- o; i "std" => "",
! N& l- ]2 ?5 H1 A2 |3 q/ `6 y ),1 A1 {- f; h: P5 A5 L+ e2 F
* U5 A) d9 P# _6 ~' T% x w array( "name" => "Insert Header Banner HTML Code (Header)
. f, [0 }( G! b3 ~# u" P <br /><em>*Recommended Size 468 x 60</em>
$ `5 z" Z0 Y7 i2 U9 y; p5 y4 H! U <br /><em>*leave blank if not use</em>",4 R1 i7 V( s8 `% v
"id" => $shortname."_header_banner",
! b3 x' I6 W/ }; y "type" => "textarea",
. P$ s3 w3 {9 d- P3 f "std" => "",, [- b6 b# l) L5 P$ n- e- E
),/ B g2 `2 g3 P9 c1 a0 c3 \% L
$ H8 H$ q# I2 T5 ]) |, Q' ~ array( "name" => "</div></div>",! a [' x" R5 X. @: O
"type" => "close",
. e3 T8 n- S: ~ ),
6 J! T X: ~7 M, ^$ e5 |! y+ X$ R+ k* V$ _
% t0 M, B( n% B0 S
array( "name" => "Header Navigation Settings",$ a% a; e' z# L* _1 s+ e
"type" => "heading",; I, c; L7 @' z7 S% i9 S
),, F% P7 |; O& r/ c# o
/ Z( L( p% E* A/ D' c array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
* O$ v |- v: f8 t8 |* g. j <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />1 n, Y- L0 _) [- ]6 H
<em>*Enter the page post ID number only</em><br />
, V" ^8 m, ?& U7 U <em>*separate by comma</em><br />% E, d. d/ k& U c
<em>*Exclude pages which you don't want to show on the header navigation</em>",
9 Q1 o" h ?& L$ ^- V5 }! P "id" => $shortname."_header_page_navigation",3 G' a9 x3 n( l# S* j
"type" => "text",
/ E* _" x _7 Y+ X7 D "std" => "",
" C( t! j7 R2 i1 [$ F: Q ),
1 j7 l% }& Q' t! z; r! t: @; {, ]/ L3 T& w
array( "name" => "</div></div>",( T; |3 G8 t( H
"type" => "close",
( d' d& ]( A/ T$ I5 I% _! m5 U ),' Q, c! G2 N! ^2 l
% M# {+ p" w+ C9 ~* ?2 Z2 U( v5 }: Z' q2 N% A$ J% B
array( "name" => "Post Auto Thumbnails Settings",
7 K- P: n @5 M1 P$ y "type" => "heading",/ n, {) h- M( r
),* p4 M8 e# V) r2 i
( i( h3 E: L2 Z; o" r' V, ~; l7 G6 J/ {
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
3 A( Q! V* s7 x" M3 E _* c' W "id" => $shortname."_timthumb_activate",- H" t' i. U: A
"type" => "select",
+ R( p$ V% w- S "std" => "No",
7 }1 ]: z) i3 ^8 D- m3 |' F "options" => array("No", "Yes")),: |" |( C6 y' ~8 l% G6 j9 ^* z
" A( r7 [' v4 N4 A" c6 [8 ~5 h4 Z" ?) \
array( "name" => "If Timthumb is enabled, Please choose its cropping method",* k' O4 z2 h( U: L3 m
"id" => $shortname."_timthumb_cropping",
4 f5 n6 E! Y% n1 f9 _" \ "type" => "select",9 K; G' Q0 F# Q8 x/ ]
"std" => "",; R' m6 I$ G; P: [( j. {
"options" => $crop_position),
0 A; s X; z0 U% r$ M( g" T* {7 D) {5 j0 E# H
array( "name" => "Insert Width Of Thumbnail Image<br />
# s3 | V1 J! ]3 S <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
( l5 V4 ?6 X, H% F. u5 Q) V <em>*Leave Blank To Use Default: 250</em><br />",
o9 Z& c# l7 H7 e% r7 K8 B "id" => $shortname."_thumb_width",; A$ U7 J' x2 c) P
"type" => "text",
- f8 f* F; z( O7 A& F3 s "std" => "",
6 w6 U4 y: E- s* e$ X" ~% F ),
3 c' Q' ]# |2 ?$ e0 J7 u" _* _' o6 c# m
array( "name" => "Insert Height Of Thumbnail Image<br />
5 v4 o( N; S: s& C- @ <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
; d0 [8 x9 V7 d' u- P <em>*Leave Blank To Use Default: 200</em><br />",: E. I5 b: S8 U: `" A
"id" => $shortname."_thumb_height",% y g/ ]/ S) |. z- W
"type" => "text",
- W7 W* A8 T* B/ _& q' c "std" => "",
2 y! X1 p8 G2 P' ~4 J& [# r$ o& a ),+ i% f7 w! n3 Z3 s0 G- e# k, M, ~
& l3 T. l5 H1 Z1 H. Z* `" G array( "name" => "</div></div>",
% @( O0 H0 u, `0 V. D, x9 ~ "type" => "close",
- C O$ w# F6 ^* r. D( V ),
+ U5 ^% t' j, I; Q* ~: U! _. W6 S2 m2 ~5 U! r" \, `4 w; I
array( "name" => "Featured Content Slider Settings",- U! }" W/ n$ y
"type" => "heading",
& M4 F/ F, V- Y9 k ),
6 _- g7 i/ |6 |# J: W* }
. ^1 n8 J5 }( }8 |! A2 C array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",3 G! @' b s6 c3 s
"id" => $shortname."_featured_activate",* r/ X }4 O* j, x: p4 s4 t% D; V
"type" => "select",
8 [: |2 D4 O; O# n# J- @& K "std" => "No",. D6 o& u) N# D$ A' s! a4 W
"options" => array("No", "Yes")),+ H2 p+ l9 Q3 j8 j
/ ]6 B1 `7 B) I; F* f
' F# g$ h5 x2 B/ r h% ~
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
) }( O0 @" C% Y "id" => $shortname."_featured_category",
' l2 Z! j8 T6 ^/ t" @6 X "type" => "select",
/ I* |; o6 O; e1 @, n2 ` "std" => "Choose a category:",
6 k ^/ Q9 a8 ] j7 r "options" => $wp_getcat), K! B! L& {! r3 f9 a% |( ~0 s* B
0 n9 w- _7 e, {) J
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",' s' B2 ?& U6 i
"id" => $shortname."_featured_number",
5 A' M! ~# _ L! f3 f6 G "type" => "select"," o3 i) d! P% E w! [0 `2 m
"std" => "Number of post:",
0 e' V4 g3 Z+ n' A$ J "options" => $number_entries),
0 t+ w z. g4 ~6 H0 L: z
/ A2 y& n: m) k3 C5 o2 T0 b+ Q array( "name" => "</div></div>",
. h" o) I/ r! k. `( {+ ]2 E! i# l "type" => "close",
1 T: [, ?- Y( k7 C; L4 J$ O8 p& f ),- C8 K `3 M4 P" I; q7 O S
7 N! U8 P) p) y3 y7 a
array( "name" => "Featured Category Settings",
9 C. x$ Y3 _1 Y' e1 V! | "type" => "heading",% U% v' P: ]3 n# o( Z
),. j" S; d$ B' Q& m+ }! Q9 r5 n5 y6 A& ?
; l7 U# {( ?" T' j
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
! `# Z5 E) P) c/ {& w. ~9 \ "id" => $shortname."_featured_category_activate",
+ t# H7 {; j' H8 c* @& o5 \4 b "type" => "select",
% V0 r% h- q7 r8 `3 t+ x "std" => "No",
- v2 Q2 Z+ P; \; l$ ^8 V/ w; o "options" => array("No", "Yes")),8 y) n5 X" [3 L
8 ~7 t, z6 p, s0 X; h6 u
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",- s. e9 k4 R# p$ O/ l; L# n
"id" => $shortname."_featured_category_id1",/ \4 |% W6 u: ` ^; C
"type" => "select",6 D7 M/ ?7 ^! E% k8 O. X
"std" => "Choose a category:",: F- ?; Z7 J& O! q6 Y
"options" => $wp_getcat),; |0 i" d% N. B6 I7 x
' R. |+ t# b3 j array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
/ H9 A3 q9 k; d. X2 \, P: r+ u "id" => $shortname."_featured_number1",5 @/ c' P4 y% B6 m6 y
"type" => "select",# }2 x- I1 X# a$ }$ C
"std" => "Number of post:",
" y( u: M. X7 \' @ "options" => $number_entries),4 V6 o t: V- S
! ^ {" a: G2 a3 j7 D+ M. @. M/ Q4 @6 l! x array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
8 X7 |8 U9 Z: g c "id" => $shortname."_featured_category_id2",
2 T; ` u" n8 ~( o C+ e3 _ "type" => "select",
7 Z2 d% A: N; r! }, W; F "std" => "Choose a category:",
" p0 \. R8 n4 M+ D) N: y "options" => $wp_getcat),4 o5 n3 }9 u4 n% |
4 n9 W% u" D2 N: B! n( W+ f/ ~ array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",! u& \$ o! I6 t4 j; b K( B
"id" => $shortname."_featured_number2",, h0 N1 `& l0 c% V. O
"type" => "select",, [6 t. M! L( w. I3 \7 a3 t
"std" => "Number of post:",
% j5 z; M8 m6 Y) T0 m: k9 D# R "options" => $number_entries),
% `% o/ x+ p8 b
: |6 W E" |7 M* m/ Y9 W1 C1 L 1 C8 j* _ N9 o' F- H
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",) A' T% F' S" i |7 `8 t
"id" => $shortname."_featured_category_id3",
f1 r0 a3 i4 @2 q "type" => "select",
) Z0 F& ~" L7 G- q "std" => "Choose a category:",
$ T8 Q; d5 z. W: |( v N$ u "options" => $wp_getcat),
* D' ~) U: A3 Y5 ], i
& f9 Z2 n+ l; X% @/ {! l" A5 L array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
1 x5 ^7 O3 g8 S/ s0 b) A b "id" => $shortname."_featured_number3",
6 J9 @. L; a/ M+ A3 [ "type" => "select",4 U; i2 L8 V; D5 ?4 i
"std" => "Number of post:",
3 G2 z) k' M( b- r "options" => $number_entries),) _) |) X( I" j% D; E
& M o0 q1 N- G/ N0 v& y' z3 B% F
# C* A1 b( ]% q array( "name" => "</div></div>",% l; w9 O H" W& C
"type" => "close",
+ j. O0 `' _0 l: [ v5 a ),
: O. B$ x- a, A0 b4 m4 u! C+ f9 ]. p+ M a1 R
4 E+ A+ j5 p" Z& ?+ u array( "name" => "Google Adsense & Analytics Settings",& [* N. r1 ^6 c* d- N& W; |" u
"type" => "heading",
4 n% d. W) x8 U" g' p; A2 o ),
) |( U" T6 s' i: K& s+ K5 w! Z7 |# Q# x5 f2 Z6 I2 ~7 n
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>", X% Y5 m8 a0 ^1 `1 E
"id" => $shortname."_adsense_loop_activate",
5 x/ _# J" E7 ^0 C) m3 X l& ^# N "type" => "select",
; O; P9 u, ^; U: @! g7 s "std" => "Disable",
- R8 ], U. Q1 ^* ] "options" => array("Disable", "Enable")),$ Z, @: q: V Q
& ^0 F0 |. a9 i, w4 Y array( "name" => "Insert Google Adsense Code For Loops Here<br />* q7 [- g7 b; R1 U/ Q
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
! h. K% m7 ?; i$ @# W "id" => $shortname."_adsense_loop",
5 Y6 }. y4 {7 e% R4 O, x I "type" => "textarea",
- P6 x6 x0 ?% m "std" => "",3 L8 v- p o7 ~5 D5 _
),
0 e' ~/ n& S7 q6 l. u% S7 @* M3 F
; N* h5 K. e; k) n$ |, Q0 X4 g array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
3 _8 `" u6 L u# H+ n* x "id" => $shortname."_adsense_single_activate",
u5 I0 p1 c9 I0 j F, {, r0 j1 ^ "type" => "select",7 N- v% z/ I0 f1 e5 n
"std" => "Disable",# n& z) k Q6 w1 _
"options" => array("Disable", "Enable")),
) O+ \3 ~/ w* u) k2 m X* {& p/ D7 E( ]- K# X! i' ^0 f: w
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
+ D+ p9 i3 P9 N: ^! R3 J <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
; D! H+ K. \& Z O3 { "id" => $shortname."_adsense_single",
" d$ J8 Y1 e% r& B- c) E# w "type" => "textarea",3 J- e" P( h5 W2 h4 U
"std" => "",. [8 r8 J1 d" }- a
),
) x. p# Y$ r/ g$ H
4 [/ m( M# h% d# Q5 Y5 P/ s3 g
! [6 [$ t3 ? a& T array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
3 x. M1 g: |% G( y, ]8 u "id" => $shortname."_google_analytics",9 ?9 s7 b; g- W$ Z
"type" => "textarea",, |7 k( d- f6 f3 X2 `9 t
"std" => "",
f+ s4 d/ i; T3 g4 T' ~ ),7 J9 B* X+ w0 o
* {' O! m. d0 H9 ^, s% i array( "name" => "</div></div>",: M0 ~3 [! I2 J" |+ P2 w
"type" => "close",: c$ K: F$ l$ n6 |- p
),
$ G" }4 O2 e+ s% i7 e/ s% u5 T8 b t
% s# v) B5 U+ n( v' G% } 2 M! Z q. k" ~& a" E: D. z0 i9 s
array( "name" => "AddThis Social Bookmarking Settings",' ~$ }* T: W# J) ^8 z
"type" => "heading",6 ~0 f1 ]! @, |+ ?: z; |
),
) |. B: Z( s- J" U6 `# q G
5 q s/ @4 w m; x8 _, p array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
" e* ~, |) q& i" z3 W9 D3 k <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",9 U( | |. F8 O1 t, V& A$ k' X7 p
"id" => $shortname."_addthis",
$ I5 t( ~4 B* T3 m" z0 U; V "type" => "text",
6 L3 Z+ y- R: W9 { "box" => "social",! e$ C h/ H# |( I
"std" => "",
7 h" }6 k# f, A) e$ \$ F ),* A; d6 j& f7 {4 X, m; u, T# o6 v
& \! A0 M& W$ s# V Y( @/ { array( "name" => "</div></div>",1 b0 \ @/ f; H& X% P/ T1 |: }; `
"type" => "close", C( w. P' Q$ G* Z _8 T/ a4 P- e2 n
),# d% A7 F% \6 N
9 {4 t- g. D4 t( N+ Z) ]/ S
5 D, t& x2 U$ I5 ~ H& R 4 h* Y; p9 b0 O0 \. T4 C% ^3 Q% N
array( "name" => "YouTube Video Settings",) \$ P; ~$ m) I: B
"type" => "heading",
' V. W7 G1 t+ x" S: F ),
/ h8 {1 k2 m9 u4 }0 o& X
- T, ]' H% F! W" l+ j! l array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
# L5 x7 D! r, B7 ^3 q "id" => $shortname."_emvideo_activate",2 ^$ W/ F) y' L+ c8 v
"type" => "select",
3 R/ H% Q4 H* n% k "std" => "No",
2 m& I5 S- F3 G) \3 h0 V "options" => array("No", "Yes")),1 i& |, y! u9 j+ {; c2 N
! M7 }) f! a5 y 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>",* M" J) R% S6 z+ [8 u
"id" => $shortname."_emvideo",* T+ R- U$ x$ h8 t5 T4 X2 c
"std" => "",0 n6 ?( O, Y. n% r( ?/ k- q
"type" => "text"),. W3 a8 r4 k2 b' F3 ?+ e1 ^
0 S8 [* u( u | array( "name" => "</div></div>",5 x3 Y1 s( s. G
"type" => "close",! n+ Q% i: }8 ?1 Q- D, _7 z
),! n3 N2 l3 n. |' a: ^- }6 A+ H
0 Z2 U' h% ~/ r- \5 f array( "name" => "Twitter Settings",, |1 _1 d& V- j( T/ e
"type" => "heading",) L& y/ W) f6 k1 ]
),
) E- P5 x, P3 l- q ~! O8 h) z6 K+ H1 E
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",! P7 ~& N; e. p' L
"id" => $shortname."_twitter_activate",
% ]/ } p# ?9 g4 w7 p" z "type" => "select",
4 h) M" e* U- q2 k/ o, K "std" => "No",
' T; e$ z ~$ I7 F$ F2 N "options" => array("No", "Yes")),: S G( E3 _% e; D0 a4 e
8 E7 P- x, L7 { array( "name" => "Insert Your Twitter ID here( ^/ k7 o3 E# D: f* @/ Y9 @$ p
<br /><em>*leave blank if not necessary</em>' f3 w+ G: r7 ~) P: u
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
' m. N& w# S3 N- N "id" => $shortname."_twitter",
9 y, O. w7 \! @) X. | "type" => "text",. p3 l# A" s& @' L5 l( q
"box" => "social",1 T/ i) \; Y% H" b
"std" => "",3 L! z3 i! L9 n0 |3 Z/ H+ x5 H$ P
)," i I' M; _' R/ @; A5 {- Z6 @6 a- @( n/ y
6 e8 M. R; p" k2 _
array( "name" => "Enter Twitter Feed Count here6 p( W: ~& u0 \# h
<br /><em>*leave blank if not necessary</em>* z/ R, n$ H4 U& ?( w
<br /><em>*Enter How Many Twitter Feed To Display</em>",7 `4 n2 J8 t9 o
"id" => $shortname."_twitter_count", l0 C& j/ ?9 }0 v+ R3 J2 e
"type" => "text",
. R9 q: j/ J+ q6 P "box" => "social",
0 m E3 q1 Q7 ? "std" => "", u: ?% @( x- l2 L! v! d
),
m1 ]6 ^' ?# P* U h& N" V! g4 d. z( t. G% ]# X! n
array( "name" => "</div></div>",
: C% U) I0 k' L "type" => "close",6 G! h+ \5 E- z# M
),7 H0 [% Z7 B, j4 e& @0 k0 C7 ?# z: q
7 |* g5 w8 ?, s9 L* |* f9 s$ Z) K
9 X! r) B7 R- H
array( "name" => "125 x 125 Banners Advertisement Settings",- ~8 o" F- R. h3 }
"type" => "heading",+ T& ?) b& Q# _4 u
), J4 n$ O* i) @! u) m# R$ M
! X, r' q, z0 M$ ]- i' S( H4 O/ d" s- a
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",/ _7 W9 @6 l8 x5 ~1 _
"id" => $shortname."_sponsor_activate",- w- F4 ^2 j" j/ D7 x+ S8 a
"type" => "select",
# L1 U* i- A/ t: D% v2 k "std" => "No",
2 d7 K+ L$ a( s$ y t& C" }( @) ] "options" => array("No", "Yes")),2 j2 }8 Y. h0 K2 L
( r: F6 i& j6 E* N
: e5 h# E1 t% C) h array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",, W `% ]3 m0 R3 i4 D
"id" => $shortname."_sponsor_banner_one",1 ]0 b" n1 ~! Q) K
"type" => "textarea",
. v# c+ Q& g5 W. O/ ^1 B ` "std" => "",
) V5 n; h: Y e/ W/ E6 c j( X ),
; T! x1 P" T, e, y( Q- P1 g; z( y6 z0 E) N
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
9 u( M4 X7 a/ m "id" => $shortname."_sponsor_banner_two",
, s4 G5 M# o$ Z" j5 f& | "type" => "textarea",
7 c W0 T0 l! {6 g "std" => "",
! `/ G. h% ^0 K8 e ),
) N2 d8 \4 {5 Q, O9 F6 L4 {2 n
" d* a" x. j7 M6 F array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",& y% c5 U3 d6 d/ p3 \9 M
"id" => $shortname."_sponsor_banner_three",: K' T; H+ M& I1 `( A2 P
"type" => "textarea",9 }1 g U! p3 J% o, D
"std" => "",
: ~7 N' c, V+ I, \ ),
6 N' b( i5 p% x; c3 G
B+ {! m! `# B2 `' T( F4 m4 ^ array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",. C) O/ d% m) `$ ^
"id" => $shortname."_sponsor_banner_four",
* y' D; ]* V. a; F+ h0 k "type" => "textarea",
g1 h1 ?2 E* J+ A- K "std" => "",8 k4 R7 k9 [% h
),
8 ~6 k" V5 ^* ^% G3 E& l) {' i) V- ]- k6 n. g
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",/ n8 K) v( e: `, {, E
"id" => $shortname."_sponsor_banner_five",
- q. X' `- K" x) ~' O: s4 I "type" => "textarea",) {! M) k( L% E
"std" => "",
5 e+ x+ }5 E! k% K ),6 M5 _" H" q; u
8 {8 L5 I8 L i) E array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
: T6 S$ ~: D, \9 @ "id" => $shortname."_sponsor_banner_six",0 _$ ^4 ~5 Y+ I
"type" => "textarea",6 @+ `1 i& J+ Y0 F+ ?
"std" => "",
. @# L8 `6 q% [* t" K+ i2 b3 C6 x ),
! w- F9 o) g0 A% @1 @( }# s _+ h9 b9 m( p
array( "name" => "</div></div>",
# v/ e5 w. J# A; T) q1 B5 z+ ~ "type" => "close",
" ~# V3 r4 ?$ q6 `/ S( E1 ? ),
$ y5 n2 E6 g7 F0 z8 C) p3 d* w
5 O) K# _3 D- m1 k; g. \. {- _$ x$ n! D7 I' ~
2 j$ W0 f& X- l1 b& ~4 T/ l2 M& E);3 r4 z" N" ]* h+ F
4 x' v7 g/ `0 u" gfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
4 u- Z. G. L4 ^$ t' \& E+ u" `; I8 [9 t8 a8 i; F% E2 o" T
echo "<div id=\"admin-options\"> ";5 Y8 Y* F3 U L7 J
0 b# Y! M+ m' e4 ^* U& ~
global $themename, $shortname, $options;
% a+ T/ R* s2 R$ s! {8 Uif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
( ]3 W" K& `5 Z: h) y' _) w6 o- eif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
: {8 o$ L. [: \?>' Z4 M9 ]. B: K. d" r, ~0 j! s
0 ~5 p4 D. V; x! H I9 N$ G' B7 C<h4><?php echo "$themename"; ?> Theme Options</h4>/ R- J. f( X3 Z/ I( _
j3 I; W0 \3 z4 M! Y/ p% M
<div class="annouce">$ `8 x m7 _3 b: {8 C; _8 L
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
9 ?: i* I1 y! S9 \7 j<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>8 k9 i" X' C9 N
</div>
/ m. c$ q) b+ D7 B. |9 C* U' u3 z
& z; Z; o9 f2 q8 Z! c<form action="" method="post">' s. G/ e/ N2 ]8 z1 R4 m0 Z5 R
' a' a7 C$ V8 U- }" d7 X<?php foreach ($options as $value) { ?>3 r! C# W4 u: @& m6 `
" Z7 z' k9 w/ F$ o( V: J0 L4 A
<?php switch ( $value['type'] ) { case 'heading': ?>
& C9 D. r# E. w$ V: e: V# E6 v8 s$ Q
<div class="get-option">
% o) X1 f) |3 ]5 s3 R7 }. G% z
4 X# v; _6 F) e<h2><?php echo $value['name']; ?></h2>/ U4 g0 s" ]+ c, }2 V0 r: _* g
0 J. d- S$ p& B8 H<div class="option-save">% h8 M: G9 P9 F/ }8 @6 d
: r) c; q1 I6 g( X! n% w" a! h y
<?php
: f5 b! i& [1 Cbreak;
: v0 \- e$ E# {2 O, j1 H1 d' ucase 'text':
+ Z$ l" e: t8 d1 o J6 u?>
, a" A/ y0 s3 \1 I. f% e: ~7 |2 p7 A3 N- s% u3 I
<div class="description"><?php echo $value['name']; ?></div>
/ F P @. o* i1 n! g<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
. |1 K5 T. c s, w% Z ]. r
* \) N! o, o! N8 ^0 gget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>( u5 R' C. d4 G
) U& X2 ]+ f. \4 Y<?php
5 c: d5 S2 o, y9 [, Ibreak;1 ]+ _: S% A$ g- |% n l
case 'select':
" T/ M- s3 ]( ~9 ]?>3 ?' U! R9 W0 _) \) i, E
( m+ v( {7 o. `* }( j4 A! }) o<div class="description"><?php echo $value['name']; ?></div>
) l {6 K6 B1 A6 _6 G+ j7 I<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">' h! d% @; {* X) A+ d. c9 d
<?php foreach ($value['options'] as $option) { ?>
& s m9 n- v5 ^; o8 z<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>7 Y+ q5 }9 U$ G
<?php } ?>$ c8 A9 b$ c+ f* [/ M
</select>
- x$ \" g: a- W* o# a! D</p>
8 z4 g" A" R; B& z% x* m8 x) l3 h+ y
$ [' o3 I" g; x<?php- z$ l( j! g3 K6 t2 s# j7 s
break;
8 j3 A: W- N/ E0 m9 S1 g A* @case 'textarea':# M3 B' g3 \3 A
$valuex = $value['id'];% n. |1 j5 l4 d0 E
$valuey = stripslashes($valuex);
' y8 ~' Y- r# E) b9 {9 H$video_code = get_settings($valuey);
2 W- s1 i, h: L7 r/ T9 c?>
+ t) `3 i6 O4 X0 U0 y- T. v* l: V3 y" p/ e. Z
<div class="description"><?php echo $value['name']; ?></div>& n' ^! _/ Q7 E0 ?3 F0 d
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
* L: O* |1 j: ?+ K! D
2 e7 o5 h( ], Q* H9 d( t: R$ ?else { echo $value['std']; } ?></textarea></p># h v! V# L! [, c8 ~6 [/ z# _
9 _5 L/ {5 A f! G3 I" ?5 g1 D @<?php# _( C4 c( _3 p% |& i
break;, V5 |/ ^+ J! V
case 'close':+ W6 f0 m! D- p# ~, q( k+ [
?>: Y G# P/ ^. i2 S
& h5 p2 t6 U9 M6 Z& u<div class="clearfix"></div>' J* A) L/ P; b+ M: x* z
</div><!-- OPTION SAVE END -->
# C' l( K; R1 ^+ R
' ~3 n! C* Q1 ~! t$ x8 o<div class="clearfix"></div>! K1 Q+ w: I+ m# L8 @9 H8 d4 V0 Y; t$ y
</div><!-- GET OPTION END -->
2 y, |6 Q+ S1 {3 B( x3 S+ ^, H. w& E6 |
$ g: w8 L9 ]& W; M4 M. l<?php! x" t5 I+ N: N$ H
break;
+ r0 z/ d" L k' mdefault;8 c q3 p: n# @
?>
% f# [* x9 {+ I' s3 g) _) c' l
% U" {5 D. m6 p9 a8 k
) v9 o! z- K1 c' Y! N! y) p1 g<?php$ Q/ j* H5 T& `, A0 N( a& o
break; } ?>9 i9 }" b5 A2 _
) J& P% E" U3 U6 L, K
<?php } ?>
+ G* ]' O( Q7 }( W8 M/ y' A: I' N
( U- }% H f! ?<p class="save-p">- m9 T/ ]" }+ }. J) |
<input name="save" type="submit" class="sbutton" value="Save Options" />
- V4 M/ Y% D8 w$ K1 M<input type="hidden" name="action" value="save" />2 h s/ N: n0 g
</p>
/ O6 M, R2 X1 |# U8 i$ e</form>+ O* a0 F6 J* c: c! e; a9 W& r
; }0 c# _; A) x9 J" H
<form method="post">
$ i$ b- n9 y5 x4 S! w<p class="save-p">
% _: Z ?! H8 h! R<input name="reset" type="submit" class="sbutton" value="Reset Options" /># ` H' S6 q+ q i' S+ x
<input type="hidden" name="action" value="reset" />, B6 A% B- P. W$ G* u
</p>: d( {# @% V* X
</form>6 z2 v: G& h# ~8 a
: ]1 C" G0 `, n! s; Y6 `. T</div><!-- ADMIN OPTIONS END -->
6 D( {, ?$ X! {% |& G8 d7 F1 n% s, }( u5 [/ z
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
4 t9 B: T# x2 u \: u; A0 y; [2 V6 k$ w4 A5 o
function mytheme_admin_register() {
( w7 H& {: Q3 p. l, W) ]1 Uglobal $themename, $shortname, $options;
|) W" n: E1 l5 _' L' W1 J1 oif ( $_GET['page'] == basename(__FILE__) ) {
6 ~) _7 `+ ]2 C, S6 @5 ~3 [if ( 'save' == $_REQUEST['action'] ) {6 B5 d# v: l) K( G; w1 N2 X
foreach ($options as $value) {$ q4 s% R v' `3 w% h! ]
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }# j J+ r; @. {% @% M
foreach ($options as $value) {& J t2 g. R6 T
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
: ^4 ?! |3 H! P" Fheader("Location: themes.php?page=functions.php&saved=true");
. N2 W) y- p1 P4 S$ hdie;/ x5 h3 p$ o$ \. g$ z, h
} else if( 'reset' == $_REQUEST['action'] ) {
" D6 D- D$ B2 s; Q% J# K2 L6 Nforeach ($options as $value) {* @/ D0 u/ H* {6 F5 _) V
delete_option( $value['id'] ); }* d% u, z8 ?" `) V5 ^0 n
header("Location: themes.php?page=functions.php&reset=true");
6 V- k, _( e8 ^9 `* y; Hdie;8 R4 H6 H) C) t8 g% g' E6 l
}, c w4 y% T0 f+ ?
}, T: v! s" b2 C; B' f
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
6 H: U& `# B- ]}0 C7 E7 `; G8 B" a, a4 v! Z! ]6 i5 m
% f# J H' P0 p- \ ^; E
function mytheme_admin_head() { ?>. N* Q- e1 x9 y) N4 w: |: C
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
1 R7 @( }: B- e7 H6 l# n v<?php }: v. f; k" A8 N% Q
|
|