|
|

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