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