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