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