|
|

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