|
|

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