|
|

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