|
|

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