|
|

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