|
|

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