|
|

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