|
|

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