|
|

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